그래서 저는 스냅 패키지를 만드는 방법을 배우려고 노력하고 있으며 간단한 파이썬 스크립트를 기반으로 사용하고 있습니다 ( https://gitlab.xirion.net/vroest/dice-roller/tree/master ).
Snapcraft가 제대로 작동하고 스냅 패키지를 설치했지만 터미널에서 스크립트를 실행할 수 없습니다.
snap install --devmode --dangerous cli-diceroller_1.9_amd64.snap
여기 가이드를 따랐습니다 : https://tutorials.ubuntu.com/tutorial/create-your-first-snap#3
다음은 yaml-file입니다.
name: cli-diceroller
base: core18
version: '1.9'
summary: A python dice rolling application using standard dice notation
description: |
Syntax is: roll <dice_code>
Example: roll 2d8 + 6 + d8
Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively.
grade: devel
confinement: devmode
apps:
roll:
command: bin/roll
parts:
diceroller:
plugin: python
python-version: python3
source: https://gitlab.xirion.net/vroest/dice-roller.git
이 명령을 실행하면 스크립트가 정상적으로 작동합니다.
/snap/cli-diceroller/x1/bin/roll
내가 뭘 놓치고 있니?
앱 이름 ( roll
이 경우)이 스냅 이름 ( cli-diceroller
)과 다른 경우 <snap-name>.<app-name>
네임 스페이스 충돌을 방지하기 위해 바이너리가 설치됩니다 .
$ cli-diceroller.roll
Syntax is: roll <dice_code>
Example: roll 2d8 + 6 + d8
Instead of a dice code you can also put "stats" or "dir" for a stats roll or direction roll respectively
부품의 이름을로 바꾸면 cli-diceroller
해당 이름으로 실행 파일을 사용할 수 있습니다. (이것은 snapcraft.yaml 참조 에 문서화되어 있습니다.)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다