-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix prompt dialog and setup issues #15
Conversation
WalkthroughThe updates across various scripts and configurations introduce a more streamlined approach to user interactions and system setup processes. By leveraging a conditional logic that hinges on user responses and environmental settings, the changes enhance the flexibility and user-friendliness of setup scripts. The introduction of a Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (15)
- home/.chezmoi.toml.tmpl (2 hunks)
- home/.chezmoiscripts/run_before_00-intro.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl (3 hunks)
- home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2 hunks)
- home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl (3 hunks)
- home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl (1 hunks)
- home/.chezmoitemplates/common (1 hunks)
- home/private_dot_config/private_fish/functions/__git.default_branch.fish (1 hunks)
Additional comments: 21
home/.chezmoi.toml.tmpl (3)
- 1-1: The introduction of the
$dev
variable to handle the "dev" environment configuration is a good practice for managing different environments. This change allows for more flexible script execution based on the environment.- 3-3: The logic for setting the email address now correctly checks the
$dev
variable instead of directly checking the environment variable. This change aligns with the objective of refining user interaction and simplifies the conditional logic.- 15-15: Including the
dev
variable in the[data]
section is a useful addition for templates that might need to conditionally render content based on the development environment. This enhances the modularity and flexibility of the configuration.home/.chezmoiscripts/run_before_00-intro.sh.tmpl (3)
- 1-1: The conditional check at the beginning of the script ensures that the script only runs in a development environment. This is consistent with the PR's objective to refine user interaction and script efficiency.
- 8-9: Simplifying the user confirmation process by directly using the
prompt
function's return value is a good practice. It eliminates the need for intermediate variable assignments and makes the script more readable and maintainable.- 15-15: Continuing the practice of directly using the
prompt
function's return value for conditional checks enhances the script's simplicity and efficiency. This change aligns with the PR's objectives.home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl (1)
- 8-8: Directly using the
prompt
function for the conditional check to install VSCode simplifies the script and aligns with the PR's goal of enhancing user interaction. This approach makes the script more concise and readable.home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl (1)
- 7-7: The modification to use a direct prompt for enabling Docker and adding the user to the Docker group simplifies the script and improves user interaction. This change is consistent with the PR's objectives and enhances script efficiency.
home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl (1)
- 10-10: Simplifying the conditional check for installing the tmux configuration by directly using the
prompt
function is a good practice. This change makes the script more concise and aligns with the PR's goal of enhancing user interaction.home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl (1)
- 8-8: Directly invoking the
prompt
function for the conditional check to install Homebrew simplifies the script and improves the user experience. This change is consistent with the PR's objectives and enhances the setup process.home/private_dot_config/private_fish/functions/__git.default_branch.fish (1)
- 1-20: The overhaul of the
__git.default_branch
function to dynamically retrieve the default branch information from a remote repository is a significant improvement. This change removes reliance on hardcoded branch names and enhances the function's flexibility and reliability.home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1)
- 8-8: Simplifying the user prompt for installing Fira Code NerdFont by directly integrating it into the conditional check is a good practice. This change makes the script more concise and aligns with the PR's goal of enhancing user interaction.
home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (1)
- 8-8: The simplification of the conditional check using the
prompt
function directly is a good improvement for readability and maintainability. Ensure to test this script in different environments to confirm theprompt
function behaves consistently.home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1)
- 8-8: The direct use of the
prompt
function for conditional checks is a clean and maintainable approach. Please ensure to test this script across different environments to verify theprompt
function's consistent behavior.home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl (2)
- 8-8: The simplification of the conditional check using the
prompt
function directly is a good improvement for readability and maintainability. Ensure to test this script in different environments to confirm theprompt
function behaves consistently.- 23-23: The direct use of the
prompt
function for conditional checks is a clean and maintainable approach. Please ensure to test this script across different environments to verify theprompt
function's consistent behavior.home/.chezmoitemplates/common (1)
- 46-56: The modification to the
prompt
function to handle user input based on the.dev
variable is a thoughtful approach to differentiate behavior in development environments. It's crucial to thoroughly test this change in various environments to ensure the intended behavior is achieved consistently.home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (1)
- 8-8: The direct use of the
prompt
function for conditional checks is a clean and maintainable approach. Please ensure to test this script across different environments to verify theprompt
function's consistent behavior.home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl (1)
- 26-26: The simplification of the conditional check using the
prompt
function directly is a good improvement for readability and maintainability. Ensure to test this script in different environments to confirm theprompt
function behaves consistently.home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2)
- 7-7: The simplification of the conditional check using the
prompt
function directly is a good improvement for readability and maintainability. Ensure to test this script in different environments to confirm theprompt
function behaves consistently.- 35-35: The direct use of the
prompt
function for conditional checks is a clean and maintainable approach. Please ensure to test this script across different environments to verify theprompt
function's consistent behavior.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (15)
- home/.chezmoi.toml.tmpl (2 hunks)
- home/.chezmoiscripts/run_before_00-intro.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl (3 hunks)
- home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl (2 hunks)
- home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl (3 hunks)
- home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl (1 hunks)
- home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl (1 hunks)
- home/.chezmoitemplates/common (1 hunks)
- home/private_dot_config/private_fish/functions/__git.default_branch.fish (1 hunks)
Files skipped from review as they are similar to previous changes (14)
- home/.chezmoi.toml.tmpl
- home/.chezmoiscripts/run_before_00-intro.sh.tmpl
- home/.chezmoiscripts/run_once_after_00-passwordless-sudo.sh.tmpl
- home/.chezmoiscripts/run_once_after_01-tmux-conf.sh.tmpl
- home/.chezmoiscripts/run_once_after_02-asdf-install.sh.tmpl
- home/.chezmoiscripts/run_once_after_03-docker-setup.sh.tmpl
- home/.chezmoiscripts/run_once_after_04-ssh-keys.sh.tmpl
- home/.chezmoiscripts/run_once_after_06_1password-setup.sh.tmpl
- home/.chezmoiscripts/run_once_after_07_vscode-setup.sh.tmpl
- home/.chezmoiscripts/run_once_after_09-font-fira-code-setup.sh.tmpl
- home/.chezmoiscripts/run_once_after_10-gh-cli-setup.sh.tmpl
- home/.chezmoiscripts/run_once_after_11_eza-setup.sh.tmpl
- home/.chezmoiscripts/run_once_before_01-install-homebrew.sh.tmpl
- home/.chezmoitemplates/common
Additional comments: 4
home/private_dot_config/private_fish/functions/__git.default_branch.fish (4)
- 3-6: Consider adding a more detailed error message to help users troubleshoot when no remote is found. For instance, suggesting to check if the repository has been initialized or if remotes have been added.
- 10-10: Executing
git remote update
with--prune
option will update and prune the specified remote. While this is generally safe, it might be unexpected for some users. It's advisable to document this behavior or provide an option to skip pruning if not necessary for determining the default branch.- 13-17: The method used to extract the default branch name using
grep
andsed
is effective but could be fragile if the output format ofgit remote show
changes in future Git versions. Consider using a more robust method or tooling if available in the fish ecosystem to parse command outputs.- 14-16: The error message "Could not determine the default branch" is clear, but it might be helpful to include the name of the remote for which the default branch could not be determined. This could aid in debugging issues with specific remotes.
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- home/private_dot_config/private_fish/functions/__git.default_branch.fish (1 hunks)
Additional comments: 3
home/private_dot_config/private_fish/functions/__git.default_branch.fish (3)
- 2-7: The approach to retrieve the global default branch name from Git configuration and defaulting to 'main' if not configured is well-implemented.
- 9-16: Handling of remote name retrieval and the fallback for when no remote is found is well thought out, ensuring the function remains useful even in repositories without a remote.
- 18-20: Fetching remote information with
--prune
to ensure up-to-date default branch information is a good practice.
home/private_dot_config/private_fish/functions/__git.default_branch.fish
Outdated
Show resolved
Hide resolved
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- home/private_dot_config/private_fish/functions/__git.default_branch.fish (1 hunks)
Additional comments: 3
home/private_dot_config/private_fish/functions/__git.default_branch.fish (3)
- 2-7: The approach to determine the global default branch name from Git configuration and defaulting to 'main' if not configured is robust and aligns with modern Git practices. Good job!
- 9-16: Handling repositories without remotes by defaulting to the configured default branch or 'main' is a thoughtful approach. Using 'origin' as the default remote name aligns with common conventions. Well done!
- 18-20: Fetching remote information with
--prune
to ensure the script operates with the most current information and maintains a clean local reference list is a good practice. Nicely done!
Summary by CodeRabbit
New Features
Refactor
prompt
function to handle user input more effectively based on the development environment setting.