-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fish support based on macOS support #100
base: master
Are you sure you want to change the base?
Conversation
Create some kind of interface for different OSes: Main functions for setting proxies are split into different files for each OS which contain identical function names. The corresponding file gets sourced at the beginning of the file.
BSD readlink has a different functionality than GNU's readlink. We need to use realpath on macOS.
BSD sed's syntax is different from the GNU one. We check for the OS in the unset function and call the corresponding sed syntax
also removed unnecessary hashtag also added networksetup entry to do_all function
...because this function is not implemented yet.
in networksetup.sh -> set_proxy()
This was a copy and paste error
macOS does not come with realpath per default, so we need a portable substitute for this
... on basis of already supported macOS
by using /usr/bin/env, we can just execute this with fish shell as well
+ make sed command OS independent + use only 1 for-loop for unsetting variables and modify variable to uppercase + make code more readable by splitting variable removal into own function
There were some flaws in the code. Fish shell needs environment variables to be explicitely unset with Additionally, the usage of the Commit 75e62e6 fixes this. EDIT: add more information |
Hi,
I added support for setting proxy variables in fish shell.
Since fish also supports setting shell variables with bash syntax, we can just use the existing code and let it write into the
config.fish
file.This PR is tested on macOS, but should work on all the other platforms as well, since there is no real difference.
This PR is based on the changes of the macOS support PR, so this should be merged afterwards.
@himanshub16 Please note: I have the same feature lying around without the macOS stuff. So if you like, I could make another PR so you can add fish support earlier. Just drop me a line :)