-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add zsh support #6
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe Changes
Poem
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.
Actionable comments posted: 2
Outside diff range and nitpick comments (2)
setup.sh (2)
14-14
: Ensure consistent argument checking logic.The argument checking logic uses modulo operation to ensure an even number of arguments, which might not be clear at first glance. Consider adding a comment to explain this logic for future maintainability.
Also applies to: 36-36
24-24
: Consider using absolute paths fordocker-compose
.Using relative paths like
cd "$SCRIPT_DIR"
can sometimes lead to errors if the script is called from different directories. It's safer to use absolute paths when invoking commands likedocker-compose
.Also applies to: 45-45
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- setup.sh (1 hunks)
Additional context used
Shellcheck
setup.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148)
[warning] 5-5: SCRIPT_DIR appears unused. Verify use (or export if used externally). (SC2034)
[error] 31-31: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting). (SC1075)
Additional comments not posted (2)
setup.sh (2)
Line range hint
5-5
: Verify the usage ofSCRIPT_DIR
or consider exporting it if used externally.Shellcheck has indicated that
SCRIPT_DIR
appears unused within the script. Please verify if it's being used in a way not visible in this snippet or consider exporting it if it's intended for external use.Tools
Shellcheck
[error] 31-31: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting). (SC1075)
57-57
: Confirm the completion message is appropriate.The script ends with a "Done" message. Verify that this message accurately reflects the completion of all intended actions, especially in error scenarios.
Thanks a ton! @ghanta1996 I would not copy paste the same code twice. Here's how I would do it
If you want to add those changes that would be great! |
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.
Actionable comments posted: 0
Hi
Thanks for the repo. It was helpful to be able to run ROS GUI from docker.
I want to add a small change to your shell script with
zsh
support.Thanks
This change is
Summary by CodeRabbit
New Features
ros_dev()
function to the user's shell configuration (~/.bashrc
or~/.zshrc
) for setting environment variables and runningdocker-compose
for ROS development.Improvements
setup.sh
script to automatically detect the user's shell and add theros_dev()
function accordingly.