Skip to content

Instantly share code, notes, and snippets.

@wozozo wozozo/init.coffee
Created Aug 17, 2015

Embed
What would you like to do?
fs = require('fs')
# Import ENV from zsh config.
fs.readFile process.env.HOME+"/.zshrc", "utf8", (err, zshFile) ->
envPaths = ['/usr/local/bin']
for l in zshFile.split('\n')
if l.substring(0,11) is 'export PATH'
e = l.split('=').splice(-1)[0]
e = e.replace(':$PATH','').replace(/"/g,'')
if ':' in e
for x in e.split(':')
envPaths.push(x)
else
envPaths.push(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.