Skip to content

Commit

Permalink
Fix incorrect check for existing files (#1738)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Nov 15, 2023
1 parent 9c423b1 commit 2098610
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node-red/rootfs/etc/s6-overlay/s6-rc.d/init-nodered/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ declare port

# Migrate add-on data from the Home Assistant config folder,
# to the add-on configuration folder.
if ! bashio::fs.directory_exists '/config/settings.js' \
if ! bashio::fs.file_exists '/config/settings.js' \
&& bashio::fs.file_exists '/homeassistant/node-red/settings.js'; then
shopt -s dotglob
mv /homeassistant/node-red/* /config/ \
|| bashio::exit.nok "Failed to migrate Node-RED configuration"
fi

# Ensure configuration exists
if ! bashio::fs.directory_exists '/config/settings.js'; then
if ! bashio::fs.file_exists '/config/settings.js'; then
mkdir -p /config/nodes \
|| bashio::exit.nok "Failed to create node-red configuration directory"

Expand Down

0 comments on commit 2098610

Please sign in to comment.