detached 3641305

refactor(installer): simplify install.sh to use download helper and remove preset logic

commit
3641305f87249e2f88db2126a6439a5fcd06d4c0
author
bnema · · 2025-10-21 06:13 UTC
parent
2e0e21d
signature
unsigned
1 file · +16 -72
M install.sh +16 -72
@@ -38,70 +38,14 @@ fi
3838
3939 # Download installer files if not present (for curl-based installation)
4040 if [ ! -d "$ARCHUP_INSTALL" ]; then
41- echo "=== Downloading ArchUp installer files ==="
42- mkdir -p "$ARCHUP_INSTALL"
43-
44- # Download all required files using curl
45- GITHUB_RAW="$ARCHUP_RAW_URL"
46-
47- # Create directory structure
48- mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,presets}
49-
50- echo "Downloading core files..."
51- curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh"
52- curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt"
53-
54- echo "Downloading helpers..."
55- for file in all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh; do
56- curl -sL "$GITHUB_RAW/install/helpers/$file" -o "$ARCHUP_INSTALL/helpers/$file"
57- done
58-
59- echo "Downloading preflight..."
60- for file in all.sh guards.sh begin.sh identify.sh detect-environment.sh; do
61- curl -sL "$GITHUB_RAW/install/preflight/$file" -o "$ARCHUP_INSTALL/preflight/$file"
62- done
63-
64- echo "Downloading partitioning..."
65- for file in all.sh detect-disk.sh partition.sh format.sh mount.sh; do
66- curl -sL "$GITHUB_RAW/install/partitioning/$file" -o "$ARCHUP_INSTALL/partitioning/$file"
67- done
68-
69- echo "Downloading base..."
70- for file in all.sh kernel.sh pacstrap.sh fstab.sh; do
71- curl -sL "$GITHUB_RAW/install/base/$file" -o "$ARCHUP_INSTALL/base/$file"
72- done
73-
74- echo "Downloading config..."
75- for file in all.sh system.sh user.sh network.sh; do
76- curl -sL "$GITHUB_RAW/install/config/$file" -o "$ARCHUP_INSTALL/config/$file"
77- done
78-
79- echo "Downloading boot..."
80- for file in all.sh limine.sh; do
81- curl -sL "$GITHUB_RAW/install/boot/$file" -o "$ARCHUP_INSTALL/boot/$file"
82- done
83-
84- echo "Downloading repos..."
85- for file in all.sh yay.sh chaotic.sh; do
86- curl -sL "$GITHUB_RAW/install/repos/$file" -o "$ARCHUP_INSTALL/repos/$file"
87- done
88-
89- echo "Downloading post-install..."
90- for file in all.sh boot-logo.sh snapper.sh verify.sh unmount.sh; do
91- curl -sL "$GITHUB_RAW/install/post-install/$file" -o "$ARCHUP_INSTALL/post-install/$file"
92- done
93-
94- echo "Downloading post-boot..."
95- mkdir -p "$ARCHUP_INSTALL/post-boot"
96- for file in all.sh snapper.sh ssh-keygen.sh archup-first-boot.service; do
97- curl -sL "$GITHUB_RAW/install/post-boot/$file" -o "$ARCHUP_INSTALL/post-boot/$file"
98- done
99-
100- echo "Downloading presets..."
101- curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages"
102-
103- echo "[OK] All files downloaded successfully"
104- echo ""
41+ # Download the download helper first
42+ mkdir -p "$ARCHUP_INSTALL/helpers"
43+ curl -sL "$ARCHUP_RAW_URL/install/helpers/download.sh" -o "$ARCHUP_INSTALL/helpers/download.sh"
44+ chmod +x "$ARCHUP_INSTALL/helpers/download.sh"
45+
46+ # Run the download script
47+ source "$ARCHUP_INSTALL/helpers/download.sh"
48+ download_archup_files
10549 fi
10650
10751 # Bootstrap: Install gum and essential dependencies (plain text, no gum usage)
@@ -143,19 +87,19 @@ source "$ARCHUP_INSTALL/boot/all.sh"
14387 # Repository setup (AUR + Chaotic)
14488 source "$ARCHUP_INSTALL/repos/all.sh"
14589
146-# Post-install (boot logo, unmount drives)
90+# Post-install (boot logo, snapper, unmount drives)
14791 source "$ARCHUP_INSTALL/post-install/all.sh"
14892
149-# ============================================================
150-# FUTURE PHASES (TO BE IMPLEMENTED)
151-# ============================================================
152-# Phase 6: Barebone preset testing
153-# Phase 7: Default preset (GUI)
154-
15593 # Stop logging and cleanup
15694 stop_install_log
15795
158-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation complete!"
96+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp barebone installation complete!"
97+echo
98+
99+gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Next steps:"
100+gum style --padding "0 0 0 $PADDING_LEFT" " 1. Reboot the system"
101+gum style --padding "0 0 0 $PADDING_LEFT" " 2. After login, run: archup wizard"
102+gum style --padding "0 0 1 $PADDING_LEFT" " 3. Select your compositor and packages"
159103 echo
160104
161105 CHOICE=$(gum choose --header "What would you like to do?" --header.padding "0 0 0 $PADDING_LEFT" "Reboot" "Close")
@@ -38,70 +38,14 @@ fi
38 38
39 # Download installer files if not present (for curl-based installation)39 # Download installer files if not present (for curl-based installation)
40 if [ ! -d "$ARCHUP_INSTALL" ]; then40 if [ ! -d "$ARCHUP_INSTALL" ]; then
41- echo "=== Downloading ArchUp installer files ==="41+ # Download the download helper first
42- mkdir -p "$ARCHUP_INSTALL"42+ mkdir -p "$ARCHUP_INSTALL/helpers"
43-43+ curl -sL "$ARCHUP_RAW_URL/install/helpers/download.sh" -o "$ARCHUP_INSTALL/helpers/download.sh"
44- # Download all required files using curl44+ chmod +x "$ARCHUP_INSTALL/helpers/download.sh"
45- GITHUB_RAW="$ARCHUP_RAW_URL"45+
46-46+ # Run the download script
47- # Create directory structure47+ source "$ARCHUP_INSTALL/helpers/download.sh"
48- mkdir -p "$ARCHUP_INSTALL"/{helpers,preflight,partitioning,base,config,boot,repos,post-install,presets}48+ download_archup_files
49-
50- echo "Downloading core files..."
51- curl -sL "$GITHUB_RAW/install/bootstrap.sh" -o "$ARCHUP_INSTALL/bootstrap.sh"
52- curl -sL "$GITHUB_RAW/logo.txt" -o "$ARCHUP_PATH/logo.txt"
53-
54- echo "Downloading helpers..."
55- for file in all.sh config.sh logging.sh errors.sh presentation.sh chroot.sh cleanup.sh; do
56- curl -sL "$GITHUB_RAW/install/helpers/$file" -o "$ARCHUP_INSTALL/helpers/$file"
57- done
58-
59- echo "Downloading preflight..."
60- for file in all.sh guards.sh begin.sh identify.sh detect-environment.sh; do
61- curl -sL "$GITHUB_RAW/install/preflight/$file" -o "$ARCHUP_INSTALL/preflight/$file"
62- done
63-
64- echo "Downloading partitioning..."
65- for file in all.sh detect-disk.sh partition.sh format.sh mount.sh; do
66- curl -sL "$GITHUB_RAW/install/partitioning/$file" -o "$ARCHUP_INSTALL/partitioning/$file"
67- done
68-
69- echo "Downloading base..."
70- for file in all.sh kernel.sh pacstrap.sh fstab.sh; do
71- curl -sL "$GITHUB_RAW/install/base/$file" -o "$ARCHUP_INSTALL/base/$file"
72- done
73-
74- echo "Downloading config..."
75- for file in all.sh system.sh user.sh network.sh; do
76- curl -sL "$GITHUB_RAW/install/config/$file" -o "$ARCHUP_INSTALL/config/$file"
77- done
78-
79- echo "Downloading boot..."
80- for file in all.sh limine.sh; do
81- curl -sL "$GITHUB_RAW/install/boot/$file" -o "$ARCHUP_INSTALL/boot/$file"
82- done
83-
84- echo "Downloading repos..."
85- for file in all.sh yay.sh chaotic.sh; do
86- curl -sL "$GITHUB_RAW/install/repos/$file" -o "$ARCHUP_INSTALL/repos/$file"
87- done
88-
89- echo "Downloading post-install..."
90- for file in all.sh boot-logo.sh snapper.sh verify.sh unmount.sh; do
91- curl -sL "$GITHUB_RAW/install/post-install/$file" -o "$ARCHUP_INSTALL/post-install/$file"
92- done
93-
94- echo "Downloading post-boot..."
95- mkdir -p "$ARCHUP_INSTALL/post-boot"
96- for file in all.sh snapper.sh ssh-keygen.sh archup-first-boot.service; do
97- curl -sL "$GITHUB_RAW/install/post-boot/$file" -o "$ARCHUP_INSTALL/post-boot/$file"
98- done
99-
100- echo "Downloading presets..."
101- curl -sL "$GITHUB_RAW/install/presets/barebone.packages" -o "$ARCHUP_INSTALL/presets/barebone.packages"
102-
103- echo "[OK] All files downloaded successfully"
104- echo ""
105 fi49 fi
106 50
107 # Bootstrap: Install gum and essential dependencies (plain text, no gum usage)51 # Bootstrap: Install gum and essential dependencies (plain text, no gum usage)
@@ -143,19 +87,19 @@ source "$ARCHUP_INSTALL/boot/all.sh"
143 # Repository setup (AUR + Chaotic)87 # Repository setup (AUR + Chaotic)
144 source "$ARCHUP_INSTALL/repos/all.sh"88 source "$ARCHUP_INSTALL/repos/all.sh"
145 89
146-# Post-install (boot logo, unmount drives)90+# Post-install (boot logo, snapper, unmount drives)
147 source "$ARCHUP_INSTALL/post-install/all.sh"91 source "$ARCHUP_INSTALL/post-install/all.sh"
148 92
149-# ============================================================
150-# FUTURE PHASES (TO BE IMPLEMENTED)
151-# ============================================================
152-# Phase 6: Barebone preset testing
153-# Phase 7: Default preset (GUI)
154-
155 # Stop logging and cleanup93 # Stop logging and cleanup
156 stop_install_log94 stop_install_log
157 95
158-gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp installation complete!"96+gum style --foreground 2 --padding "1 0 1 $PADDING_LEFT" "ArchUp barebone installation complete!"
97+echo
98+
99+gum style --foreground 6 --padding "0 0 0 $PADDING_LEFT" "Next steps:"
100+gum style --padding "0 0 0 $PADDING_LEFT" " 1. Reboot the system"
101+gum style --padding "0 0 0 $PADDING_LEFT" " 2. After login, run: archup wizard"
102+gum style --padding "0 0 1 $PADDING_LEFT" " 3. Select your compositor and packages"
159 echo103 echo
160 104
161 CHOICE=$(gum choose --header "What would you like to do?" --header.padding "0 0 0 $PADDING_LEFT" "Reboot" "Close")105 CHOICE=$(gum choose --header "What would you like to do?" --header.padding "0 0 0 $PADDING_LEFT" "Reboot" "Close")

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close