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

Don't touch .bashrc if the tmc executable is already in $PATH #254

Open
nygrenh opened this issue Jun 14, 2016 · 5 comments
Open

Don't touch .bashrc if the tmc executable is already in $PATH #254

nygrenh opened this issue Jun 14, 2016 · 5 comments
Labels

Comments

@nygrenh
Copy link
Member

nygrenh commented Jun 14, 2016

This occurs for example when tmc-cli is installed from npm.

One problem with this is that your autocomplete solution seems to depend on the .bashrc modification. This could be fixed by installing the appropriate autocompletion files globally (for example to /etc/bash_completion.d) when installing and placing the the executable directly to the $PATH

@jclc
Copy link
Contributor

jclc commented Jun 16, 2016

Note: also don't add if there is an alias called "tmc"

Edit: Actually, this might be impossible to check since aliases aren't usually initialised in scripts.

@jclc jclc changed the title Don't touch .bashrc if the tmc executable is already in $PATH Don't touch .bashrc if the tmc executable is already in $PATH Jun 16, 2016
@jclc jclc added the bug label Jun 16, 2016
@Salmela
Copy link
Contributor

Salmela commented Jul 11, 2016

We should export variable so that we can easily detect if the tmc-cli is already installed in scripts.

The problem with aliases is that they aren't inherited by sub-shells.

@Salmela
Copy link
Contributor

Salmela commented Sep 4, 2016

The tmc launcher won't do anything if the tmc auto-completion file exists (~/.tmc-autocomplete.sh). It's location can be overridden with $TMC_AUTOCOMPLETE_FILE global variable

@Salmela Salmela closed this as completed Sep 4, 2016
@nygrenh
Copy link
Member Author

nygrenh commented Sep 5, 2016

@Salmela Expecting package maintainers to set arbitrary environment variables seems unreasonable to me.

@nygrenh nygrenh reopened this Sep 5, 2016
@Salmela
Copy link
Contributor

Salmela commented Sep 6, 2016

Good call. I just assumed that package manager would put the autocompletion script into same place as the tmc launcher script, which wouldn't work very well because the default location was in the home directory.

I now changed it so that if the tmc is in read-only directory then it won't try to create the tmc autocompletion script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants