fix(install): process cleanup flag after helper files are downloaded
- commit
- b0fb8707852f28d8e00d3da057c08095dfb1ef5d
- author
- bnema · · 2025-10-20 21:09 UTC
- committer
- bnema · · 2025-10-20 19:19 UTC
- parent
- 09b7a59
- signature
- unsigned
2 files · +8 -6
M CHANGELOG.md +1 -0
| @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. | |||
| 6 | 6 | ||
| 7 | 7 | ### Fixed | |
| 8 | 8 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | |
| 9 | + | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | |
| 9 | 10 | ||
| 10 | 11 | ## [0.1.0] - 2025-10-21 | |
| 11 | 12 | ||
| @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. | |||||
| 6 | 6 | ||||
| 7 | ### Fixed | 7 | ### Fixed | ||
| 8 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | 8 | - **Curl-pipe installation**: Fixed curl-based one-liner installation by auto-detecting piped input, re-executing with TTY for interactive prompts, and running bootstrap before downloads | ||
| 9 | + | - **Cleanup flag**: Fixed --cleanup flag to run after helper files are downloaded | |||
| 9 | 10 | ||||
| 10 | ## [0.1.0] - 2025-10-21 | 11 | ## [0.1.0] - 2025-10-21 | ||
| 11 | 12 | ||||
M install.sh +7 -6
| @@ -23,12 +23,7 @@ export ARCHUP_INSTALL_CONFIG="/var/log/archup-install.conf" | |||
| 23 | 23 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | |
| 24 | 24 | export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema/archup/dev}" | |
| 25 | 25 | ||
| 26 | - | # Handle command-line flags | |
| 27 | - | if [ "$1" = "--cleanup" ]; then | |
| 28 | - | echo "Running cleanup before installation..." | |
| 29 | - | source "$ARCHUP_INSTALL/helpers/cleanup.sh" default | |
| 30 | - | fi | |
| 31 | - | ||
| 26 | + | # Handle help flag early (doesn't need any files) | |
| 32 | 27 | if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then | |
| 33 | 28 | cat << 'HELP' | |
| 34 | 29 | Usage: install.sh [OPTIONS] | |
| @@ -71,6 +66,12 @@ fi | |||
| 71 | 66 | # Source all helper utilities (now safe to use gum) | |
| 72 | 67 | source "$ARCHUP_INSTALL/helpers/all.sh" | |
| 73 | 68 | ||
| 69 | + | # Handle cleanup flag (after helpers are available) | |
| 70 | + | if [ "$1" = "--cleanup" ]; then | |
| 71 | + | echo "Running cleanup before installation..." | |
| 72 | + | source "$ARCHUP_INSTALL/helpers/cleanup.sh" default | |
| 73 | + | fi | |
| 74 | + | ||
| 74 | 75 | # Display logo | |
| 75 | 76 | clear_logo | |
| 76 | 77 | ||
| @@ -23,12 +23,7 @@ export ARCHUP_INSTALL_CONFIG="/var/log/archup-install.conf" | |||||
| 23 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | 23 | export ARCHUP_REPO_URL="${ARCHUP_REPO_URL:-https://github.com/bnema/archup}" | ||
| 24 | export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema/archup/dev}" | 24 | export ARCHUP_RAW_URL="${ARCHUP_RAW_URL:-https://raw.githubusercontent.com/bnema/archup/dev}" | ||
| 25 | 25 | ||||
| 26 | - | # Handle command-line flags | 26 | + | # Handle help flag early (doesn't need any files) |
| 27 | - | if [ "$1" = "--cleanup" ]; then | |||
| 28 | - | echo "Running cleanup before installation..." | |||
| 29 | - | source "$ARCHUP_INSTALL/helpers/cleanup.sh" default | |||
| 30 | - | fi | |||
| 31 | - | ||||
| 32 | if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then | 27 | if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then | ||
| 33 | cat << 'HELP' | 28 | cat << 'HELP' | ||
| 34 | Usage: install.sh [OPTIONS] | 29 | Usage: install.sh [OPTIONS] | ||
| @@ -71,6 +66,12 @@ fi | |||||
| 71 | # Source all helper utilities (now safe to use gum) | 66 | # Source all helper utilities (now safe to use gum) | ||
| 72 | source "$ARCHUP_INSTALL/helpers/all.sh" | 67 | source "$ARCHUP_INSTALL/helpers/all.sh" | ||
| 73 | 68 | ||||
| 69 | + | # Handle cleanup flag (after helpers are available) | |||
| 70 | + | if [ "$1" = "--cleanup" ]; then | |||
| 71 | + | echo "Running cleanup before installation..." | |||
| 72 | + | source "$ARCHUP_INSTALL/helpers/cleanup.sh" default | |||
| 73 | + | fi | |||
| 74 | + | ||||
| 74 | # Display logo | 75 | # Display logo | ||
| 75 | clear_logo | 76 | clear_logo | ||
| 76 | 77 | ||||