cloudsidedev / appside

Multitenant environment automation.
http://cloudside.ch
GNU Affero General Public License v3.0
38 stars 7 forks source link

Don't blindly add bash autocompletion #111

Closed swissspidy closed 6 years ago

swissspidy commented 6 years ago

The autocompletion part should be added on a new line in .bashrc/.zshrc.

https://github.com/ttssdev/appflow/blob/3f5048927c0cab3eb1540e56d17701ae3c083de4/lib/appflow/appflow_tools.py#L48-L72

My .bashrc looks like this after installing appflow:

-[ -n "$PS1" ] && source ~/.bash_profile
 No newline at end of file
+[ -n "$PS1" ] && source ~/.bash_profilesource /Users/Pascal/.appflow_completion

The source /Users/Pascal/.appflow_completion part should be on a new line. Also, ideally it would use ~as a shorthand.

As you can see, all my config's in ~/.bash_profile anyway, so I manually added this line to it. It would be great if Appflow would not try to add the line to .bashrc in the future when autocompletion already works.

ivomarino commented 6 years ago

hoi @swissspidy do you want to fix it by yourself? so we could add it with a pull request, as suggestion to speed things up a bit.

swissspidy commented 6 years ago

I could try, but I'm not really familiar with Python. It depends a bit on what the best solution would be. Most scripts I use don't automatically add autocompletion config to the user's .bashrc/.bash_profile. Perhaps Appflow shouldn't either, as I don't think there's an easy way to detect if it's already working or not. Plus, perhaps some users don't even want autocompletion turned on.

ivomarino commented 6 years ago

@swissspidy good suggestion in fact, thanks. @89luca89 what do you think?

89luca89 commented 6 years ago

Hi @swissspidy I have removed it in the new version in Branch 25 I'm working on