|  | @@ -13,7 +13,7 @@ source $SNAP/helper/functions
 | 
	
		
			
				|  |  |  test_default_config
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  # Update deviceConfigPriorityDir to match new revision
 | 
	
		
			
				|  |  | -if [ -f "${SNAP_DATA}" ]; then
 | 
	
		
			
				|  |  | +if [ -d "${SNAP_DATA}" ]; then
 | 
	
		
			
				|  |  |  	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
 | 
	
		
			
				|  |  |  	    jq --arg deviceConfigPriorityDir ${PRIORITY_DIR} '.zwave.deviceConfigPriorityDir = $deviceConfigPriorityDir' $SNAP_DATA/settings.json > $SNAP_DATA/tmp.json
 | 
	
	
		
			
				|  | @@ -23,11 +23,8 @@ if [ -f "${SNAP_DATA}" ]; then
 | 
	
		
			
				|  |  |  	fi
 | 
	
		
			
				|  |  |  fi
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -EXT_CONFIG_DIR="${ZWAVEJS_EXTERNAL_CONFIG-${SNAP_DATA}/.ext-config}"
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  # 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
 | 
	
		
			
				|  |  |  # Discussed with Al Calzone, lead dev of Zwavejs, can just be deleted and re-build
 | 
	
		
			
				|  |  | -if [ -d "${EXT_CONFIG_DIR}" ]; then 
 | 
	
		
			
				|  |  | -	rm -f "${EXT_CONFIG_DIG}/devices/index.json"
 | 
	
		
			
				|  |  | -fi
 | 
	
		
			
				|  |  | +EXT_CONFIG_DIR="${ZWAVEJS_EXTERNAL_CONFIG-${SNAP_DATA}/.ext-config}"
 | 
	
		
			
				|  |  | +rm -f "${EXT_CONFIG_DIG}/devices/index.json"
 |