When I am programming my modules for cross platform I have done specific checks for IsMacOs or IsLinux and then changed the paths that way. I also use now PSFramework where I can store them in a central config and recall them from there which makes life easier.
For mac you can open the Terminal and run the command
printenv.For displaying the value of any specific environment variable run the
echo $[variable name].You can set a temporary variable by opening the terminal and running
export command followed by the variable name and its value: Daves-MacBook-Pro:~ DaveG$ export GITHUB_HOME=/Library/GitHub/.
Mac uses bash shell. The environment variables can be added to the
.bash_profile directory, for the current user. The path to this file can be found using the command: Daves-MacBook-Pro:~ DaveG$ ~/.bash_profile.
Just use a text editor to edit the file and if no file exists then you can create a new file called
.bash_profile. Edit the file and add your desired environment variables using
export command. Save it and restart terminal and you should be good to go.