Failed to generate snap metadata errors


I’m trying to snap a very simple script and I can’t seem to figure out what I’m doing wrong.

This is my directory tree:

└── snap
    └── snapcraft.yaml

This is my snapcraft.yaml file:

name: numpy-dice-hy
base: core18
version: git
summary: Dice roller using numpy.
description: Dice roller using numpy.

grade: devel
confinement: devmode

    plugin: python
    python-version: python3
    source-type: git
    python-packages: [numpy]


When I run the snapcraft command I get the following error:
Failed to generate snap metadata: The specified command '' defined in the app 'numpy-dice-hy' does not exist or is not executable. Ensure that '' is relative to the prime directory.

When I run snapcraft --debug my script is located in ./project/ which is ../project/ relative to the prime directory. If I change the command path in the yaml file to that I then get a new error: Failed to run '/bin/sh /tmp/tmpktn8oklg': Exited with code 1. . Obviously that’s not the answer to the problem. How do I comply with making my script relative to the prime directory?

Any help would be appreciated.

I’ve resolved my issue after walking away from it for the evening. Part of the issue was the and part of it was my misunderstanding of certain values.

My directory structure now looks like this:

├── bin
│   └──
├── numpy-dice-hy
│   ├──
│   └──
└── snap
    └── snapcraft.yaml```
The key it seems is that the needs to install the script where the snap expects it. ```scripts=['bin/'],```
snapcraft.yaml: ```command: bin/```

Once I made these adjustments the snapcraft process works.  Hopefully this helps others in the future.