detached dd03646

fix(review): address PR #2 inline review findings

commit
dd03646b63eb079aa994e7f88638911cf278d83f
author
brice · · 2026-02-27 04:57 UTC
parent
74791d1
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
7 files · +15 -6
M install/mandatory/post-boot/cli-tools.sh +3 -3
@@ -9,14 +9,14 @@ USER_HOME=$(getent passwd "$USERNAME" | cut -d: -f6)
99 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }
1010
1111 if [[ -z "$USERNAME" ]]; then
12- log "ERROR: Could not detect user in /home"
12+ log "ERROR: Could not detect user via getent passwd"
1313 exit 1
1414 fi
1515
1616 log "Installing modern CLI toolkit for $USERNAME..."
1717
18-log "Refreshing package databases..."
19-pacman -Sy --noconfirm
18+log "Upgrading system and refreshing package databases..."
19+pacman -Syu --noconfirm
2020
2121 pacman -S --needed --noconfirm \
2222 eza bat fd ripgrep fzf zoxide starship \
@@ -9,14 +9,14 @@ USER_HOME=$(getent passwd "$USERNAME" | cut -d: -f6)
9 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }9 log() { echo "[cli-tools] $*" | tee -a "$LOG_FILE"; }
10 10
11 if [[ -z "$USERNAME" ]]; then11 if [[ -z "$USERNAME" ]]; then
12- log "ERROR: Could not detect user in /home"12+ log "ERROR: Could not detect user via getent passwd"
13 exit 113 exit 1
14 fi14 fi
15 15
16 log "Installing modern CLI toolkit for $USERNAME..."16 log "Installing modern CLI toolkit for $USERNAME..."
17 17
18-log "Refreshing package databases..."18+log "Upgrading system and refreshing package databases..."
19-pacman -Sy --noconfirm19+pacman -Syu --noconfirm
20 20
21 pacman -S --needed --noconfirm \21 pacman -S --needed --noconfirm \
22 eza bat fd ripgrep fzf zoxide starship \22 eza bat fd ripgrep fzf zoxide starship \
M install/mandatory/post-boot/dms-opt-in.sh +6 -2
@@ -57,8 +57,12 @@ case "$REPLY" in
5757 [yY][eE][sS]|[yY])
5858 log "User opted in — starting Dank Linux installer."
5959 echo "Starting Dank Linux installer..."
60- curl -fsSL https://install.danklinux.com | sh
61- log "Dank Linux installation complete."
60+ if curl -fsSL https://install.danklinux.com | sh; then
61+ log "Dank Linux installation complete."
62+ else
63+ log "ERROR: Dank Linux installer failed (exit code $?)."
64+ exit 1
65+ fi
6266 ;;
6367 *)
6468 log "User skipped Dank Linux installation."
@@ -57,8 +57,12 @@ case "$REPLY" in
57 [yY][eE][sS]|[yY])57 [yY][eE][sS]|[yY])
58 log "User opted in — starting Dank Linux installer."58 log "User opted in — starting Dank Linux installer."
59 echo "Starting Dank Linux installer..."59 echo "Starting Dank Linux installer..."
60- curl -fsSL https://install.danklinux.com | sh60+ if curl -fsSL https://install.danklinux.com | sh; then
61- log "Dank Linux installation complete."61+ log "Dank Linux installation complete."
62+ else
63+ log "ERROR: Dank Linux installer failed (exit code $?)."
64+ exit 1
65+ fi
62 ;;66 ;;
63 *)67 *)
64 log "User skipped Dank Linux installation."68 log "User skipped Dank Linux installation."
M internal/application/handlers/post_install_handler.go +1 -0
@@ -62,6 +62,7 @@ func (h *PostInstallHandler) Handle(ctx context.Context, cmd commands.PostInstal
6262 // Write Dank Linux flag file if user opted in
6363 if cmd.InstallDankLinux {
6464 if err := h.writeDankLinuxFlag(cmd.MountPoint); err != nil {
65+ result.ErrorDetail = fmt.Sprintf("Failed to write Dank Linux flag: %v", err)
6566 return result, fmt.Errorf("failed to write dank linux flag: %w", err)
6667 }
6768 result.TasksRun = append(result.TasksRun, "dank-linux-flag")
@@ -62,6 +62,7 @@ func (h *PostInstallHandler) Handle(ctx context.Context, cmd commands.PostInstal
62 // Write Dank Linux flag file if user opted in62 // Write Dank Linux flag file if user opted in
63 if cmd.InstallDankLinux {63 if cmd.InstallDankLinux {
64 if err := h.writeDankLinuxFlag(cmd.MountPoint); err != nil {64 if err := h.writeDankLinuxFlag(cmd.MountPoint); err != nil {
65+ result.ErrorDetail = fmt.Sprintf("Failed to write Dank Linux flag: %v", err)
65 return result, fmt.Errorf("failed to write dank linux flag: %w", err)66 return result, fmt.Errorf("failed to write dank linux flag: %w", err)
66 }67 }
67 result.TasksRun = append(result.TasksRun, "dank-linux-flag")68 result.TasksRun = append(result.TasksRun, "dank-linux-flag")
M internal/application/handlers/post_install_handler_test.go +1 -0
@@ -177,6 +177,7 @@ func TestPostInstallHandler_Handle_WithDankLinux(t *testing.T) {
177177 mockLogger.EXPECT().LogPath().Return("/var/log/archup-install.log").AnyTimes()
178178 mockFS.EXPECT().Exists(gomock.Any()).Return(false, nil).AnyTimes()
179179 mockFS.EXPECT().ReadFile(gomock.Any()).Return([]byte("graphics: yes"), nil).AnyTimes()
180+ mockFS.EXPECT().WriteFile(gomock.Eq("/mnt/var/lib/archup-install-danklinux"), gomock.Any(), gomock.Any()).Return(nil)
180181 mockFS.EXPECT().WriteFile(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
181182 mockFS.EXPECT().MkdirAll(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
182183 mockHTTP.EXPECT().Get(gomock.Any()).Return(newMockResponse(ctrl, http.StatusOK, []byte("content")), nil).AnyTimes()
@@ -177,6 +177,7 @@ func TestPostInstallHandler_Handle_WithDankLinux(t *testing.T) {
177 mockLogger.EXPECT().LogPath().Return("/var/log/archup-install.log").AnyTimes()177 mockLogger.EXPECT().LogPath().Return("/var/log/archup-install.log").AnyTimes()
178 mockFS.EXPECT().Exists(gomock.Any()).Return(false, nil).AnyTimes()178 mockFS.EXPECT().Exists(gomock.Any()).Return(false, nil).AnyTimes()
179 mockFS.EXPECT().ReadFile(gomock.Any()).Return([]byte("graphics: yes"), nil).AnyTimes()179 mockFS.EXPECT().ReadFile(gomock.Any()).Return([]byte("graphics: yes"), nil).AnyTimes()
180+ mockFS.EXPECT().WriteFile(gomock.Eq("/mnt/var/lib/archup-install-danklinux"), gomock.Any(), gomock.Any()).Return(nil)
180 mockFS.EXPECT().WriteFile(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()181 mockFS.EXPECT().WriteFile(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
181 mockFS.EXPECT().MkdirAll(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()182 mockFS.EXPECT().MkdirAll(gomock.Any(), gomock.Any()).Return(nil).AnyTimes()
182 mockHTTP.EXPECT().Get(gomock.Any()).Return(newMockResponse(ctrl, http.StatusOK, []byte("content")), nil).AnyTimes()183 mockHTTP.EXPECT().Get(gomock.Any()).Return(newMockResponse(ctrl, http.StatusOK, []byte("content")), nil).AnyTimes()
M internal/interfaces/tui/app.go +2 -0
@@ -328,8 +328,10 @@ func (a *App) handleDankLinuxInput(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
328328 switch msg.String() {
329329 case "up", "shift+tab":
330330 a.dankLinuxModel.MoveUp()
331+ return a, nil
331332 case "down", "tab":
332333 a.dankLinuxModel.MoveDown()
334+ return a, nil
333335 case "enter":
334336 a.formData.InstallDankLinux = a.dankLinuxModel.SelectedOption().Value
335337 return a.startInstallation()
@@ -328,8 +328,10 @@ func (a *App) handleDankLinuxInput(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
328 switch msg.String() {328 switch msg.String() {
329 case "up", "shift+tab":329 case "up", "shift+tab":
330 a.dankLinuxModel.MoveUp()330 a.dankLinuxModel.MoveUp()
331+ return a, nil
331 case "down", "tab":332 case "down", "tab":
332 a.dankLinuxModel.MoveDown()333 a.dankLinuxModel.MoveDown()
334+ return a, nil
333 case "enter":335 case "enter":
334 a.formData.InstallDankLinux = a.dankLinuxModel.SelectedOption().Value336 a.formData.InstallDankLinux = a.dankLinuxModel.SelectedOption().Value
335 return a.startInstallation()337 return a.startInstallation()
M internal/interfaces/tui/models/form.go +1 -0
@@ -311,6 +311,7 @@ func (fm *FormModelImpl) extractData() {
311311 Timezone: fm.fields[4].Value(),
312312 Locale: fm.fields[5].Value(),
313313 Keymap: fm.fields[6].Value(),
314+ InstallDankLinux: fm.data.InstallDankLinux,
314315 }
315316 }
316317
@@ -311,6 +311,7 @@ func (fm *FormModelImpl) extractData() {
311 Timezone: fm.fields[4].Value(),311 Timezone: fm.fields[4].Value(),
312 Locale: fm.fields[5].Value(),312 Locale: fm.fields[5].Value(),
313 Keymap: fm.fields[6].Value(),313 Keymap: fm.fields[6].Value(),
314+ InstallDankLinux: fm.data.InstallDankLinux,
314 }315 }
315 }316 }
316 317
M internal/shell/configurator.go +1 -1
@@ -20,6 +20,6 @@ func (c *Configurator) Configure(username, userHome string) (ConfigResult, error
2020 return ConfigResult{
2121 ThemesApplied: 0,
2222 ThemesFailed: []string{},
23- Warnings: []string{},
23+ Warnings: []string{"Shell configuration deferred to cli-tools.sh on first boot"},
2424 }, nil
2525 }
@@ -20,6 +20,6 @@ func (c *Configurator) Configure(username, userHome string) (ConfigResult, error
20 return ConfigResult{20 return ConfigResult{
21 ThemesApplied: 0,21 ThemesApplied: 0,
22 ThemesFailed: []string{},22 ThemesFailed: []string{},
23- Warnings: []string{},23+ Warnings: []string{"Shell configuration deferred to cli-tools.sh on first boot"},
24 }, nil24 }, nil
25 }25 }

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