-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[install.sh] add flag not to modify exist config file during installation #810
Conversation
What is the use case for this? Isn't the purpose of the installation to enable Bash-it by including it in the config file that is run when you start a new shell? I'm not sure I understand how someone would use Bash-it in this case. |
i manage config files on github and, in my config file, bash_it config is already written. |
OK, got it. In that case - wouldn't it be smarter to detect whether the config file already contains the required lines that load Bash-it? I would like to avoid having lots of questions in the installer if possible, especially when many of the questions aren't required for the majority of users. |
Current problem is that there is no way to run the install script while keeping config file unmodified. i think it is not a long flow for installation, and, in the case that program modify file, it should ask. |
Yes, I get your use case, but I still feel that adding an additional question is too invasive, as for most users, the answer will be "Yes, please modify the file." Answering "No" will be a complete edge case, and I don't expect to see that frequently used. Like I said, a much better option would be to check whether the config file already contains the required lines. Instead of asking the user, the install script would figure it out on its own. In your case, it would see that your What do you think about that? |
i always want to say 'No, do not modify it' to install script, but it is my case. for scraping config file, what you mean 'required line' is i think whenever program modify existing file, they should ask it or tell it to user. |
Thanks for the additional information, this makes it a lot easier to understand your use case. Based on what you wrote, maybe using the install script is not a good idea. The primary purpose of the install script is to ensure that Bash-it is loaded when the user starts a new shell. Out of curiosity, if you're not using a line like the one you quoted, how do you load Bash-it from your Also, when you run the install script, do you use it in interactive mode, so that it asks you about every plugin to enable? Or how do you use the installer? There might be better options for you to achieve the same thing. I think your use case would better be covered by an additional command line flag to the install script. If the flag is provided, it doesn't modify the config file. How about that? |
i rewrite alias with my own alias files so that i make bash code not to source bash_it alias when i get new computer, i often run install script with interactive mode and delete generated bashrc. |
Since I keep my dotfiles in a Git repo, I don't run the installer when setting up a new machine - I simply clone my dotfile repo and enable the Bash-it components that I need. The bashrc file already contains the lines that load Bash-it - no need to do that again, same as you. I keep a script in my dotfiles repo that clones Bash-it and then enables what I need - maybe that would be useable approach for you as well? Here's the script in case you're interested: https://github.com/nwinkler/dotfiles/blob/master/install_bash_it.sh Feel free to update the PR with a change that implements your feature through a flag instead of a question. |
cool example script! |
Sure, you're welcome. Looking forward to the updated PR! |
c3db83e
to
6b07098
Compare
i updated to use flag |
@nwinkler friendly ping. if you have time, can you review? |
Sorry about the delay - I've been pretty busy. I'll try to find time today... |
thank you :) i'm not in hurry, so it's up to you |
Sorry for the delay, finally had time to review this. Some findings:
Could you please take a look at these two items? Looks great otherwise. |
thank you for quick review, i will fix it :) |
6b07098
to
89bb325
Compare
89bb325
to
ce65f57
Compare
i fixed bug and i add description in README. |
Thanks - works fine now! Thanks again for hanging in there and accepting a compromise. If only more people would be like that 😄 |
thank you so much for reviewing many times 😄 |
[install.sh] add flag not to modify exist config file during installation
What is changed
.bashrc
) during installationthere is no way to run
install.sh
, keeping config file (i.e..bashrc
) unchanged.therefore, i add this option for interactive mode.