When building a snap with
base: core20 snapcraft is stricter in the commands that it accepts. This is a problem when you need to either escape a character or include quotes to surround a path with spaces. For example, I’m working on GOG Galaxy Wine right now and I need to include the full path to the executable inside the WINEPREFIX but this has spaces so I need to put quotes around it to prevent the shell breaking it into multiple parameters:
command: bin/sommelier "$WINEPREFIX/drive_c/Program Files/GOG Galaxy/GalaxyClient.exe"
Output of snapcraft:
Failed to generate snap metadata: The specified command 'bin/sommelier "$WINEPREFIX/drive_c/Program Files/GOG Galaxy/GalaxyClient.exe"' defined in the app 'gog-galaxy-wine' does not match the pattern expected by snapd.
The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
Run the same command again with --debug to shell into the environment if you wish to introspect this failure.