Simplify install command
This commit is contained in:
@@ -25,7 +25,7 @@ Options:
|
||||
--force 使用 git reset --hard origin/<branch> 覆盖本地改动
|
||||
--skip-git 跳过 git 拉取,只部署当前工作区
|
||||
--bootstrap-system
|
||||
首次安装时使用 sudo 安装 Ubuntu 系统依赖,应用仍部署在用户目录
|
||||
强制使用 sudo 安装 Ubuntu 系统依赖;首次安装会默认执行
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ require_command() {
|
||||
}
|
||||
|
||||
bootstrap_system_packages() {
|
||||
if [[ "${BOOTSTRAP_SYSTEM}" != "1" ]]; then
|
||||
if [[ "${BOOTSTRAP_SYSTEM}" != "1" && -f "${ENV_FILE}" ]]; then
|
||||
return
|
||||
fi
|
||||
require_command sudo "首次安装系统依赖需要 sudo。"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user