Skip to content

Conversation

@chetanc10
Copy link

Tested for bash only, though it should be applicable for other 'simple' shells but NOT fish.

Before this patch, every shell session reload redundantly updates $PATH:

root@b888df0f96a7:/# echo $PATH | grep "\.basher/bin"
/root/.basher/cellar/bin:/root/.basher/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@b888df0f96a7:/# exec bash -l
root@b888df0f96a7:/# echo $PATH | grep "\.basher/bin"
/root/.basher/bin:/root/.basher/cellar/bin:/root/.basher/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@b888df0f96a7:/# exec bash -l
root@b888df0f96a7:/# echo $PATH | grep "\.basher/bin"
/root/.basher/bin:/root/.basher/bin:/root/.basher/cellar/bin:/root/.basher/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

After this patch, PATH is not redundantly updated for every shell reload:

root@b888df0f96a7:/# exec bash -l
root@b888df0f96a7:/# echo $PATH | grep "$HOME/.basher/bin"
/root/.basher/cellar/bin:/root/.basher/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@b888df0f96a7:/# exec bash -l
root@b888df0f96a7:/# echo $PATH | grep "$HOME/.basher/bin"
/root/.basher/cellar/bin:/root/.basher/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Signed-off-by: ChetaN KS <chetan.kumarsanga@gmail.com>
@juanibiapina
Copy link
Member

Thanks for the contribution. How about adding a test for this?

@chetanc10
Copy link
Author

Unable to find proper way to add test for install.sh so far as it's not run in controlled environment like basher test cases.

Will check and update.

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