Quellcode durchsuchen

Symlink zwave-js index.json

Joachim M. Giæver vor 4 Jahren
Ursprung
Commit
9ce3d09ef3
2 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
  1. 7 3
      snap/snapcraft.yaml
  2. 2 0
      src/bin/env-wrapper

+ 7 - 3
snap/snapcraft.yaml

@@ -29,6 +29,7 @@ apps:
       - network
       - network-bind
       - raw-usb
+      - serial-port
   exec:
     environment:
       STORE_DIR: $SNAP_DATA
@@ -39,6 +40,8 @@ apps:
       - network
       - network-bind
       - raw-usb
+      - serial-port
+      - hardware-observe
   help:
     command: bin/env-wrapper --help
   enable:
@@ -51,9 +54,8 @@ apps:
 layout:
   /usr/src/app/store:
     bind: $SNAP_DATA/zwavejs2mqtt/store
-  #/usr/lib/zwavejs2mqtt/node_modules/@zwave-js/config/config/devices/index.json:
-  /usr/lib/zwavejs2mqtt/node_modules/@zwave-js/config/config/devices/index.json:
-    bind-file: $SNAP/usr/lib/zwavejs2mqtt/node_modules/@zwave-js/config/config/devices/index.json
+  /usr/config/devices/index.json:
+    bind-file: $SNAP_DATA/config/devices/index.json
 
 parts:
   zwavejs2mqtt:
@@ -69,12 +71,14 @@ parts:
       - jq
     stage-packages:
       - git
+      - udev
     override-build: |
       set -ex
       npm config set unsafe-perm true
       npm install detect-libc
       npm run build
       chmod +x $SNAPCRAFT_PART_BUILD/bin/www
+      ln -s /usr/config/devices/index.json $SNAPCRAFT_PART_BUILD/node_modules/\@zwave-js/config/config/devices/index.json
       cp -rf $SNAPCRAFT_PART_BUILD $SNAPCRAFT_PART_INSTALL/usr/lib/zwavejs2mqtt
     stage:
       - -usr/lib/zwavejs2mqtt/kubernetes

+ 2 - 0
src/bin/env-wrapper

@@ -42,6 +42,8 @@ if [ "${1}" = "--help" ]; then
     OPT_HELP=true
 fi
 
+export GIT_DIR="${SNAP}/usr/lib/zwavejs2mqtt/.git"
+
 if [ ${OPT_HELP} = true ]; then
     echo "Zwavejs2mqtt ($ ($ 1 --version))"
     echo ""