Reading Environment Variables

fig.env is an object that contains environment variables from the shell. For the moment,fig.env is only available when you explicitly call a fig command from the shell. This means fig.env is null if you link from one app to another without running a command in the user's terminal.

Examples

let currentDirectory = fig.env.PWD
let xpc = fig.env["XPC_SERVICE_NAME"]

The most important environment variables probably be PWD, HOME and USER (note all-caps)

Last updated