Skip to content

Instantly share code, notes, and snippets.

@brosner
Created December 2, 2014 14:25

Revisions

  1. brosner created this gist Dec 2, 2014.
    14 changes: 14 additions & 0 deletions init.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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