fix: use user dir on Windows, detect pipe execution for one-click install
- Windows default: $env:USERPROFILE\hapi instead of C:\hapi - PowerShell: detect iex/pipe execution ($PSCommandPath empty) to skip Read-Host prompt and enter quick install mode - Bash: detect curl|bash pipe (! -t 0) to enter quick install mode - This fixes scripts hanging on menu prompts when run via irm|iex or curl|bash via [HAPI](https://hapi.run) Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
+2
-2
@@ -1503,8 +1503,8 @@ main() {
|
||||
|
||||
: > "$LOG_FILE"
|
||||
|
||||
# 如果带有旧版参数,进入快速模式
|
||||
if [[ "$UPGRADE_ONLY" == true || "$FORCE" == true || -n "$SOURCE" || "$SKIP_HUB" == true || -n "$INSTALL_DIR_ARG" ]]; then
|
||||
# 如果带有旧版参数,或是管道执行(curl | bash),进入快速模式
|
||||
if [[ "$UPGRADE_ONLY" == true || "$FORCE" == true || -n "$SOURCE" || "$SKIP_HUB" == true || -n "$INSTALL_DIR_ARG" || ! -t 0 ]]; then
|
||||
echo ""
|
||||
echo -e "${BOLD}╔══════════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${BOLD}║${NC} HAPI 快速模式 ${BOLD}║${NC}"
|
||||
|
||||
Reference in New Issue
Block a user