Таким образом, я пытаюсь изучить, как создать поспешный пакет и использую простой сценарий Python в качестве основы (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-файл:
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 ссылке.)