Script cannot find files inside var/snap/xwiki/x1

hey guys,

I wanted to run a script inside /var/snap/xwiki/x1/xwiki-platform-distribution-jetty-hsqldb-13.10.8/start_xwiki.sh .

the shell script inside snap/xwiki/x1/start.sh is as follows:

#!/bin/bash
./$SNAP_DATA/xwiki-platform-distribution-jetty-hsqldb-13.10.8/start_xwiki.sh

parts and apps in my snapcraft.yaml:

scripts:
source: ./scripts/
plugin: dump

override-build: |
  snapcraftctl build
  chmod +x start.sh

apps:
 start:
   command: ./start.sh
   plugs: [home,network,network-bind]

running sudo xwiki.start gives the following error(no such file or director):

/snap/xwiki/x1/start.sh: line 2: .//var/snap/xwiki/x1/xwiki-platform-distribution-jetty-hsqldb-13.10.8/start_xwiki.sh: No such file or directory

but the var/snap/xwiki/x1 has the following file.

the entire snapcraft.yaml

try removing the ./ before $SNAP_DATA in the script.sh file …

1 Like

lol that made it work …thanks again @ogra :slight_smile: