-
Notifications
You must be signed in to change notification settings - Fork 0
Testing reviewer #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ alias ..="cd .." | |||||||||
| alias ...="cd ../.." | ||||||||||
| alias ....="cd ../../.." | ||||||||||
| alias .....="cd ../../../.." | ||||||||||
| alias dev='cd ~/dev' | ||||||||||
| alias dev="cd ~/dev " | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The alias contains a trailing space inside the quoted command, which becomes part of the executed command and may cause unexpected behavior. Remove the trailing space so the alias expands cleanly.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The alias contains a trailing space inside the quoted command, which becomes part of the executed command and can cause unexpected behavior. Remove the trailing space so the alias expands cleanly.
Suggested change
|
||||||||||
|
|
||||||||||
| # Enable aliases to be sudo’ed | ||||||||||
| alias sudo='sudo ' | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,5 +15,8 @@ alias gwr="git worktree remove" | |||||||||||||||||
| alias gwl="git worktree list" | ||||||||||||||||||
| alias gup="git fetch origin && git merge origin/main" | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| git config --global user.name "Bruno Bergher" | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The aliases file sets global Git config on shell startup by running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The two lines at the end of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is sourced on every shell startup via .zshrc, so running global Git config here will execute each time and may overwrite user preferences or slow startup. Move these to the bootstrap flow and guard them (e.g., only set if unset) so they run once. |
||||||||||||||||||
| git config --global user.email me@brunobergher.com | ||||||||||||||||||
|
Comment on lines
21
to
22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running global Git config in an aliases file will execute on every shell startup (this file is sourced by .zshrc). This can repeatedly overwrite user preferences and adds overhead. Guard these calls (or move them to bootstrap.sh to run once during setup).
Suggested change
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,27 +1,13 @@ | ||||||
| #!/usr/bin/env bash | ||||||
|
|
||||||
| echo "Bootstrapping dotfiles…"; | ||||||
| cd "$(dirname "${BASH_SOURCE}")"; | ||||||
|
|
||||||
| git pull origin main; | ||||||
|
|
||||||
| function doIt() { | ||||||
| rsync --exclude ".git/" \ | ||||||
| --exclude ".DS_Store" \ | ||||||
| --exclude ".osx" \ | ||||||
| --exclude "bootstrap.sh" \ | ||||||
| --exclude "README.md" \ | ||||||
| --exclude "LICENSE-MIT.txt" \ | ||||||
| -avh --no-perms . ~; | ||||||
| source ~/.bash_profile; | ||||||
| } | ||||||
|
|
||||||
| if [ "$1" == "--force" -o "$1" == "-f" ]; then | ||||||
| doIt; | ||||||
| else | ||||||
| read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1; | ||||||
| echo ""; | ||||||
| if [[ $REPLY =~ ^[Yy]$ ]]; then | ||||||
| doIt; | ||||||
| fi; | ||||||
| fi; | ||||||
| unset doIt; | ||||||
| rsync --exclude ".git/" \ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The updated Suggested minimal actions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change removes the interactive confirmation/--force guard, which makes the bootstrap destructive by default. Reintroduce a prompt or a --force flag so accidental overwrites are avoided by default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the interactive confirmation/--force guard makes this script destructive by default and increases risk of accidental overwrites. Reintroduce a prompt or a --force flag so the default path is safe. |
||||||
| --exclude ".DS_Store" \ | ||||||
| --exclude ".osx" \ | ||||||
| --exclude "bootstrap.sh" \ | ||||||
| --exclude "README.md" \ | ||||||
| --exclude "LICENSE-MIT.txt" \ | ||||||
| -avh --no-perms . ~ > /dev/null; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redirecting rsync output to /dev/null hides failures and makes troubleshooting harder. Keep errors visible (or avoid silencing altogether) so problems surface during bootstrap.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Redirecting rsync output to /dev/null hides failures and makes troubleshooting harder. Keep errors visible (or avoid silencing altogether) so problems surface during bootstrap. |
||||||
| source ~/.zshrc; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sourcing ~/.zshrc from a non-interactive bash script can cause unintended side effects and mixes shells. Prefer not to source it here; ask the user to start a new terminal session (or, if absolutely needed, exec zsh in a controlled subshell). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sourcing ~/.zshrc from a non-interactive bash script can cause unintended side effects and mixes shells. Prefer not to source it here; ask the user to restart their shell (or exec zsh in a controlled subshell). Replacing this line with a comment avoids side effects.
Suggested change
|
||||||
| echo "Done. Start a new terminal session to see the changes."; | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias
alias dev="cd ~/dev "inaliases/cli.shcontains a trailing space inside the quoted command. That trailing space becomes part of the executed command and can lead to unexpected behavior (the extra space will be passed to the shell when the alias expands). Remove the trailing space so it readsalias dev="cd ~/dev".