Skip to content
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

warn user that installation with --system flag will fail if she's not root #464 #465

Closed
wants to merge 1 commit into from

Conversation

Mizou04
Copy link

@Mizou04 Mizou04 commented Sep 5, 2023

fix for issue #464

@postmodern postmodern self-requested a review September 5, 2023 21:16
Copy link
Owner

@postmodern postmodern left a comment

Choose a reason for hiding this comment

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

It's generally a bad practice to put additional logic in option parsing. The option parser should only parse the options. Any validation logic should happen once all of the options have been parsed. This prevents issues where options can be specified in different orders.

I feel like testing if $install_dir is writable is a better solution, as that will also catch edge-cases where the user is trying to explicitly install ruby to somewhere else on the system: ruby-install --install-dir /opt/ ruby, etc This guard logic could be added to pre_install or directly to bin/ruby-install.

@Mizou04 Mizou04 closed this Sep 5, 2023
@Mizou04 Mizou04 deleted the warn_if_nonroot branch September 5, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants