Simplify install command

This commit is contained in:
武阳
2026-05-07 12:10:30 +08:00
parent 6c75f0f979
commit b72eae5da7
3 changed files with 18 additions and 37 deletions
+9
View File
@@ -54,6 +54,15 @@ command -v git >/dev/null 2>&1 || {
exit 1
}
if [[ -e "${APP_DIR}" && ! -d "${APP_DIR}/.git" ]]; then
echo "${APP_DIR} already exists but is not a git repository." >&2
echo "Please move it away, or rerun with --force to replace it." >&2
if [[ "${FORCE}" != "1" ]]; then
exit 1
fi
rm -rf "${APP_DIR}"
fi
if [[ -d "${APP_DIR}/.git" ]]; then
cd "${APP_DIR}"
git fetch origin