Created
December 2, 2014 14:25
-
-
Save brosner/5e111c8d3226747eea98 to your computer and use it in GitHub Desktop.
Per-window environment variables in Atom
This file contains 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
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