Last active
August 19, 2020 16:10
-
-
Save lgoldstien/8453726 to your computer and use it in GitHub Desktop.
A simple script to load workspace specific environment variables and the like.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function workspace_cd() { | |
cd $@ && [ -f ".workspace" ] && source .workspace | |
} | |
alias cd="workspace_cd" |
Any directory you cd into that has a .workspace
file inside will cause the .workspace
file to be sourced.
A demonstraion of a .workspace
file could be:
export GOPATH=/Users/lg/Documents/Projects/SomeGoProject
export PATH=$PATH:$GOPATH/bin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source this in your .profile