feat(download): create dedicated download helper with gum spinners
- commit
- 2e0e21d638504f078d5e9611785d7fd3f411816e
- author
- bnema · · 2025-10-21 06:13 UTC
- parent
- 100763f
- signature
- unsigned
1 file · +80 -0
A install/helpers/download.sh +80 -0
| @@ -0,0 +1,80 @@ | |||
| 1 | + | #!/bin/bash | |
| 2 | + | # Download all required ArchUp installation files from GitHub | |
| 3 | + | ||
| 4 | + | download_section() { | |
| 5 | + | local title="$1" | |
| 6 | + | local target_dir="$2" | |
| 7 | + | shift 2 | |
| 8 | + | local files=("$@") | |
| 9 | + | ||
| 10 | + | gum spin --spinner dot --title "$title" -- bash -c " | |
| 11 | + | for file in ${files[*]}; do | |
| 12 | + | curl -sL '$GITHUB_RAW/install/$target_dir/\$file' -o '$ARCHUP_INSTALL/$target_dir/\$file' 2>/dev/null | |
| 13 | + | done | |
| 14 | + | " | |
| 15 | + | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | download_archup_files() { | |
| 19 | + | echo "" | |
| 20 | + | gum style --foreground 212 --bold "ArchUp Installer Download" | |
| 21 | + | echo "" | |
| 22 | + | ||
| 23 | + | local GITHUB_RAW="$ARCHUP_RAW_URL" | |
| 24 | + | ||
| 25 | + | # Create directory structure | |
| 26 | + | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | |
| 27 | + | ||
| 28 | + | # Core files | |
| 29 | + | gum spin --spinner dot --title "Downloading core files..." -- bash -c " | |
| 30 | + | curl -sL '$GITHUB_RAW/install/bootstrap.sh' -o '$ARCHUP_INSTALL/bootstrap.sh' 2>/dev/null | |
| 31 | + | curl -sL '$GITHUB_RAW/logo.txt' -o '$ARCHUP_PATH/logo.txt' 2>/dev/null | |
| 32 | + | " | |
| 33 | + | gum style --foreground 2 "[OK] Core files downloaded" | |
| 34 | + | ||
| 35 | + | # Helpers | |
| 36 | + | download_section "Downloading helpers..." "helpers" \ | |
| 37 | + | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh | |
| 38 | + | ||
| 39 | + | # Preflight | |
| 40 | + | download_section "Downloading preflight checks..." "preflight" \ | |
| 41 | + | all.sh guards.sh begin.sh identify.sh detect-environment.sh | |
| 42 | + | ||
| 43 | + | # Partitioning | |
| 44 | + | download_section "Downloading partitioning scripts..." "partitioning" \ | |
| 45 | + | all.sh detect-disk.sh partition.sh format.sh mount.sh | |
| 46 | + | ||
| 47 | + | # Base system | |
| 48 | + | download_section "Downloading base system scripts..." "base" \ | |
| 49 | + | all.sh kernel.sh pacstrap.sh fstab.sh | |
| 50 | + | ||
| 51 | + | # Configuration | |
| 52 | + | download_section "Downloading config scripts..." "config" \ | |
| 53 | + | all.sh system.sh user.sh network.sh | |
| 54 | + | ||
| 55 | + | # Bootloader | |
| 56 | + | download_section "Downloading bootloader setup..." "boot" \ | |
| 57 | + | all.sh limine.sh | |
| 58 | + | ||
| 59 | + | # Repositories | |
| 60 | + | download_section "Downloading repository setup..." "repos" \ | |
| 61 | + | all.sh aur.sh chaotic.sh | |
| 62 | + | ||
| 63 | + | # Post-install | |
| 64 | + | download_section "Downloading post-install scripts..." "post-install" \ | |
| 65 | + | all.sh boot-logo.sh plymouth.sh snapper.sh post-boot-setup.sh hooks.sh verify.sh unmount.sh | |
| 66 | + | ||
| 67 | + | # Post-boot | |
| 68 | + | download_section "Downloading post-boot scripts..." "post-boot" \ | |
| 69 | + | all.sh snapper.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service | |
| 70 | + | ||
| 71 | + | # Base packages | |
| 72 | + | gum spin --spinner dot --title "Downloading package list..." -- bash -c " | |
| 73 | + | curl -sL '$GITHUB_RAW/install/base.packages' -o '$ARCHUP_INSTALL/base.packages' 2>/dev/null | |
| 74 | + | " | |
| 75 | + | gum style --foreground 2 "[OK] Package list downloaded" | |
| 76 | + | ||
| 77 | + | echo "" | |
| 78 | + | gum style --foreground 2 --bold "[OK] All files downloaded successfully" | |
| 79 | + | echo "" | |
| 80 | + | } | |
| @@ -0,0 +1,80 @@ | |||||
| 1 | + | #!/bin/bash | |||
| 2 | + | # Download all required ArchUp installation files from GitHub | |||
| 3 | + | ||||
| 4 | + | download_section() { | |||
| 5 | + | local title="$1" | |||
| 6 | + | local target_dir="$2" | |||
| 7 | + | shift 2 | |||
| 8 | + | local files=("$@") | |||
| 9 | + | ||||
| 10 | + | gum spin --spinner dot --title "$title" -- bash -c " | |||
| 11 | + | for file in ${files[*]}; do | |||
| 12 | + | curl -sL '$GITHUB_RAW/install/$target_dir/\$file' -o '$ARCHUP_INSTALL/$target_dir/\$file' 2>/dev/null | |||
| 13 | + | done | |||
| 14 | + | " | |||
| 15 | + | gum style --foreground 2 "[OK] ${title/Downloading /Downloaded }" | |||
| 16 | + | } | |||
| 17 | + | ||||
| 18 | + | download_archup_files() { | |||
| 19 | + | echo "" | |||
| 20 | + | gum style --foreground 212 --bold "ArchUp Installer Download" | |||
| 21 | + | echo "" | |||
| 22 | + | ||||
| 23 | + | local GITHUB_RAW="$ARCHUP_RAW_URL" | |||
| 24 | + | ||||
| 25 | + | # Create directory structure | |||
| 26 | + | mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,post-boot} | |||
| 27 | + | ||||
| 28 | + | # Core files | |||
| 29 | + | gum spin --spinner dot --title "Downloading core files..." -- bash -c " | |||
| 30 | + | curl -sL '$GITHUB_RAW/install/bootstrap.sh' -o '$ARCHUP_INSTALL/bootstrap.sh' 2>/dev/null | |||
| 31 | + | curl -sL '$GITHUB_RAW/logo.txt' -o '$ARCHUP_PATH/logo.txt' 2>/dev/null | |||
| 32 | + | " | |||
| 33 | + | gum style --foreground 2 "[OK] Core files downloaded" | |||
| 34 | + | ||||
| 35 | + | # Helpers | |||
| 36 | + | download_section "Downloading helpers..." "helpers" \ | |||
| 37 | + | all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh | |||
| 38 | + | ||||
| 39 | + | # Preflight | |||
| 40 | + | download_section "Downloading preflight checks..." "preflight" \ | |||
| 41 | + | all.sh guards.sh begin.sh identify.sh detect-environment.sh | |||
| 42 | + | ||||
| 43 | + | # Partitioning | |||
| 44 | + | download_section "Downloading partitioning scripts..." "partitioning" \ | |||
| 45 | + | all.sh detect-disk.sh partition.sh format.sh mount.sh | |||
| 46 | + | ||||
| 47 | + | # Base system | |||
| 48 | + | download_section "Downloading base system scripts..." "base" \ | |||
| 49 | + | all.sh kernel.sh pacstrap.sh fstab.sh | |||
| 50 | + | ||||
| 51 | + | # Configuration | |||
| 52 | + | download_section "Downloading config scripts..." "config" \ | |||
| 53 | + | all.sh system.sh user.sh network.sh | |||
| 54 | + | ||||
| 55 | + | # Bootloader | |||
| 56 | + | download_section "Downloading bootloader setup..." "boot" \ | |||
| 57 | + | all.sh limine.sh | |||
| 58 | + | ||||
| 59 | + | # Repositories | |||
| 60 | + | download_section "Downloading repository setup..." "repos" \ | |||
| 61 | + | all.sh aur.sh chaotic.sh | |||
| 62 | + | ||||
| 63 | + | # Post-install | |||
| 64 | + | download_section "Downloading post-install scripts..." "post-install" \ | |||
| 65 | + | all.sh boot-logo.sh plymouth.sh snapper.sh post-boot-setup.sh hooks.sh verify.sh unmount.sh | |||
| 66 | + | ||||
| 67 | + | # Post-boot | |||
| 68 | + | download_section "Downloading post-boot scripts..." "post-boot" \ | |||
| 69 | + | all.sh snapper.sh ssh-keygen.sh archup-cli.sh archup-first-boot.service | |||
| 70 | + | ||||
| 71 | + | # Base packages | |||
| 72 | + | gum spin --spinner dot --title "Downloading package list..." -- bash -c " | |||
| 73 | + | curl -sL '$GITHUB_RAW/install/base.packages' -o '$ARCHUP_INSTALL/base.packages' 2>/dev/null | |||
| 74 | + | " | |||
| 75 | + | gum style --foreground 2 "[OK] Package list downloaded" | |||
| 76 | + | ||||
| 77 | + | echo "" | |||
| 78 | + | gum style --foreground 2 --bold "[OK] All files downloaded successfully" | |||
| 79 | + | echo "" | |||
| 80 | + | } | |||