Browse Source

Update reference to rootDir in .ext-dir

Joachim M. Giæver 3 years ago
parent
commit
64bb7fce43
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/hooks/post-refresh

+ 3 - 1
src/hooks/post-refresh

@@ -14,8 +14,10 @@ test_default_config
 
 
 # Update deviceConfigPriorityDir to match new revision
 # Update deviceConfigPriorityDir to match new revision
 PRIORITY_DIR=$(echo "$(sed -E "s#$(dirname ${SNAP_DATA})/(current|[0-9]+)#${SNAP_DATA}#g" <<< $(cat "${SNAP_DATA}/settings.json" | jq '.zwave.deviceConfigPriorityDir'))" | tr -d '"')
 PRIORITY_DIR=$(echo "$(sed -E "s#$(dirname ${SNAP_DATA})/(current|[0-9]+)#${SNAP_DATA}#g" <<< $(cat "${SNAP_DATA}/settings.json" | jq '.zwave.deviceConfigPriorityDir'))" | tr -d '"')
-
 if [ -d $(dirname "${PRIORITY_DIR}") ]; then
 if [ -d $(dirname "${PRIORITY_DIR}") ]; then
     jq --arg deviceConfigPriorityDir ${PRIORITY_DIR} '.zwave.deviceConfigPriorityDir = $deviceConfigPriorityDir' $SNAP_DATA/settings.json > $SNAP_DATA/tmp.json
     jq --arg deviceConfigPriorityDir ${PRIORITY_DIR} '.zwave.deviceConfigPriorityDir = $deviceConfigPriorityDir' $SNAP_DATA/settings.json > $SNAP_DATA/tmp.json
     mv $SNAP_DATA/tmp.json $SNAP_DATA/settings.json
     mv $SNAP_DATA/tmp.json $SNAP_DATA/settings.json
 fi
 fi
+
+# Update references to the external config directory
+sed -iE "s#$(dirname ${SNAP_DATA})/(current|[0-9]+)#${SNAP_DATA}/#g" $ZWAVEJS_EXTERNAL_CONFIG/devices/index.json