Skip to content

Instantly share code, notes, and snippets.

@brosner
Created December 2, 2014 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brosner/5e111c8d3226747eea98 to your computer and use it in GitHub Desktop.
Save brosner/5e111c8d3226747eea98 to your computer and use it in GitHub Desktop.
Per-window environment variables in Atom
fs = require("fs")
path = require("path")
fs.readFile path.join(atom.project.getPath(), ".atom-env"), "utf8", (err, data) ->
if data?
for line in data.split "\n"
if line != ""
pair = line.split "="
key = pair[0]
value = pair[1]
if value.indexOf "." == 0
value = path.normalize (path.join atom.project.getPath(), value)
process.env[key] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment