fix(install): allow curl-pipe bash when set -u is enabled

BASH_SOURCE[0] is unset for stdin scripts; call main directly in
install-1panel-docker.sh and quick-install.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Deploy
2026-06-06 02:11:40 +08:00
parent d884ea00ca
commit 222703d733
3 changed files with 8 additions and 6 deletions
+2 -3
View File
@@ -271,6 +271,5 @@ main() {
phase_nexus
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
# curl | bash 时 stdin 脚本无 BASH_SOURCE[0],不可配合 set -u 做入口判断
main "$@"
+2 -3
View File
@@ -120,6 +120,5 @@ main() {
run_via_git "$@"
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fi
# curl | bash 时 stdin 脚本无 BASH_SOURCE[0],不可配合 set -u 做入口判断
main "$@"
@@ -34,3 +34,7 @@ curl -fsSL ".../install-1panel-docker.sh" | bash -s -- --skip-1panel
- `bash -n deploy/install-1panel-docker.sh`
- 逻辑审阅:不写入 `/opt/1panel/apps/`,反代仍由用户在 1Panel UI 配置
## 补丁(同日)
- `curl | bash``BASH_SOURCE[0]``set -u` 时为 unbound → 入口改为直接 `main "$@"``install-1panel-docker.sh``quick-install.sh`