Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/plugins/terminal/scripts/init-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ if [ "$1" = "--installing" ]; then
fi

mkdir -p "$PREFIX/.configured"

if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc" && chmod 644 "$HOME/.bashrc"
fi
Comment on lines +46 to +48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The touch line uses 7-space indentation (3 spaces inside the if) while the rest of the --installing block uses 4-space indentation. Consistent 4-space inner indentation (8 spaces total) would match the surrounding code style.

Suggested change
if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc" && chmod 644 "$HOME/.bashrc"
fi
if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc" && chmod 644 "$HOME/.bashrc"
fi

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


echo "Installation completed."
Comment on lines +46 to 50
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The .bashrc is created only in the --installing branch, which runs once at first setup. Users who already have $PREFIX/.configured (i.e., existing installs) and no .bashrc will never hit this path on upgrade — they'd need to reinstall or create the file manually. Moving this guard into the normal startup path ($# -eq 0) would ensure every user gets a .bashrc regardless of when they installed.

Suggested change
if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc" && chmod 644 "$HOME/.bashrc"
fi
echo "Installation completed."
if [ ! -f "$HOME/.bashrc" ]; then
touch "$HOME/.bashrc" && chmod 644 "$HOME/.bashrc"
fi
echo "Installation completed."
# NOTE: also add the same guard in the "$#" -eq 0 branch so that
# existing users who upgrade without a .bashrc get one on next start.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

exit 0
fi
Expand Down