justinmayer / virtualfish

Fish shell tool for managing Python virtual environments
MIT License
1.07k stars 101 forks source link

Avoid erroneous warning if venv activated with trailing slash #213

Closed ammgws closed 2 years ago

ammgws commented 3 years ago

Both vf activate myvenv and vf activate myvenv/ successfully activate the venv, but the latter causes a warning to be printed to the terminal.

Came across this because at some stage a trailing slash somehow ended up at the end of my activate command.

The trailing slash doesn't cause any issues with activation since the venv's are directories, and trailing slashes do not cause issues with the various functions (test -d etc) used in virtualfish when activating a venv, so for the warning message just checking the basename should be fine.

justinmayer commented 2 years ago

Sincere apologies for the delay in reviewing. Many thanks for the enhancement, Jason! ✨