diff --git a/deploy.sh b/deploy.sh index 72c962f..af94b3b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -31,6 +31,20 @@ if [ -d "${REMOTE_PATH}/.git" ]; then echo "Repository exists, pulling latest changes..." cd ${REMOTE_PATH} git pull +elif [ -d "${REMOTE_PATH}" ]; then + echo "Directory exists but is not a git repo, converting..." + # Backup config.js if it exists + if [ -f "${REMOTE_PATH}/config.js" ]; then + cp "${REMOTE_PATH}/config.js" /tmp/unraid-dash-config.js.bak + fi + rm -rf ${REMOTE_PATH} + git clone ${GIT_REPO} ${REMOTE_PATH} + cd ${REMOTE_PATH} + # Restore config.js if backed up + if [ -f /tmp/unraid-dash-config.js.bak ]; then + mv /tmp/unraid-dash-config.js.bak ${REMOTE_PATH}/config.js + echo "Restored config.js" + fi else echo "Cloning repository..." git clone ${GIT_REPO} ${REMOTE_PATH}