Skip to content

Instantly share code, notes, and snippets.

@ryupold
Created May 17, 2019 12:39
Show Gist options
  • Save ryupold/16178929ff15d64572c87c1b1e5d82a0 to your computer and use it in GitHub Desktop.
Save ryupold/16178929ff15d64572c87c1b1e5d82a0 to your computer and use it in GitHub Desktop.
2 ways to set environment variables in macOS
launchctl setenv APP_VERSION "$APP_VERSION"
echo "App Version: $(launchctl getenv APP_VERSION)"
echo ""
export APP_VERSION=1.2.3
launchctl setenv APP_VERSION "1.2.3"
export APP_VERSION=$(launchctl getenv APP_VERSION)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment