After reading the "building snap tutorial" and checking the documentation, other tutorials and some examples, I'm still confused about how the command section in the .yaml for the snaps works, or better said, how I can invoke the snap.
Some of the tutorials just use "command: example" and run the snap typing "example", other use "command: bin/example" or even "command: bin/example.sh".
I understand they are pointing at the folder where the executable file is located, so I did the same with my .yaml trying to reach and execute the jar who runs my daemon:
apps: daemon-test: command: java -cp $SNAP/basic-project-0.0.1-SNAPSHOT.jar es.ramadorp.odm.snapcraft.test.daemon.Daemontest restart-condition: always daemon: simple
But when type "daemon-test" or "name-snap.daemon-test" I get the "command not found" prompt. Going further than solving my problem (which it'd great), I have some questions:
- Why the bin folder in "command"? is autogenerated by snapcraft? is it mandatory in some specific cases?
- Why sometimes you need a .sh and others just need to write a name for running the snap?
- When do you need to write just the word in command and when do you need to write the name-snap.command-word?
- When do you need to point to a "executable file" and when is not needed, just a word?
P.D: Am I pointing correctly to my executable jar? I also tried adding the route to the /prime/jar/ folder but nothing.