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

feat: add y/n dialog before modifying rcfile #35

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

tusharsadhwani
Copy link
Owner

@tusharsadhwani tusharsadhwani commented Aug 1, 2024

Resolves #34

@tusharsadhwani
Copy link
Owner Author

@pawamoy can you run install.sh manually (download file from github / git clone whatever works) and confirm that it asks for confirmation before modification?

Ensure that .yen/bin isn't already in your rcfile. It should ask for confirmation before adding it in.

@pawamoy
Copy link

pawamoy commented Aug 2, 2024

% sh install.sh 
This script will automatically download and install yen for you.
Getting it from this url: https://github.com/tusharsadhwani/yen/releases/latest/download/yen-rs-x86_64-unknown-linux-musl
The binary will be installed into '/home/pawamoy/.yen/bin'
############################################################################################################################################################################## 100.0%
############################################################################################################################################################################## 100.0%
############################################################################################################################################################################## 100.0%
Install 'yen' in '/home/pawamoy/.zshrc'? [y/n] 
Please restart or source your shell.

🎉

@tusharsadhwani
Copy link
Owner Author

Awesome. Simply merging this PR will change the behaviour of the curl command to the new behaviour. So, consider it fixed!

@tusharsadhwani tusharsadhwani merged commit 4a0ad9a into main Aug 2, 2024
16 checks passed
@tusharsadhwani tusharsadhwani deleted the install-confirmation branch August 2, 2024 14:16
@pawamoy
Copy link

pawamoy commented Aug 2, 2024

Ah you're too fast! I was going to suggest printing a message showing how to "source" yen when the user chooses not to modify the rc file 🙂

Something like:

To enable yen in you shell environment, add this command to the startup script of your choice:

export PATH="${PATH}:/home/pawamoy/.yen/bin"

@tusharsadhwani
Copy link
Owner Author

whoops

@tusharsadhwani
Copy link
Owner Author

I think it's fine for now as the script does mention where the binary will be put. If you think it needs improvement do send a PR.

@pawamoy
Copy link

pawamoy commented Aug 2, 2024

Yes, I agree, I think it's fine too 🙂

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.

Usual "don't modify my shell environment" issue
2 participants