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:
@@ -271,6 +271,5 @@ main() {
|
|||||||
phase_nexus
|
phase_nexus
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
# curl | bash 时 stdin 脚本无 BASH_SOURCE[0],不可配合 set -u 做入口判断
|
||||||
main "$@"
|
main "$@"
|
||||||
fi
|
|
||||||
|
|||||||
@@ -120,6 +120,5 @@ main() {
|
|||||||
run_via_git "$@"
|
run_via_git "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
# curl | bash 时 stdin 脚本无 BASH_SOURCE[0],不可配合 set -u 做入口判断
|
||||||
main "$@"
|
main "$@"
|
||||||
fi
|
|
||||||
|
|||||||
@@ -34,3 +34,7 @@ curl -fsSL ".../install-1panel-docker.sh" | bash -s -- --skip-1panel
|
|||||||
|
|
||||||
- `bash -n deploy/install-1panel-docker.sh`
|
- `bash -n deploy/install-1panel-docker.sh`
|
||||||
- 逻辑审阅:不写入 `/opt/1panel/apps/`,反代仍由用户在 1Panel UI 配置
|
- 逻辑审阅:不写入 `/opt/1panel/apps/`,反代仍由用户在 1Panel UI 配置
|
||||||
|
|
||||||
|
## 补丁(同日)
|
||||||
|
|
||||||
|
- `curl | bash` 下 `BASH_SOURCE[0]` 在 `set -u` 时为 unbound → 入口改为直接 `main "$@"`(`install-1panel-docker.sh`、`quick-install.sh`)
|
||||||
|
|||||||
Reference in New Issue
Block a user