steelbrain / exec

Node's Process spawning APIs beautified
MIT License
9 stars 4 forks source link

Issue with custom .bash_profile on macOS #99

Open rm-code opened 6 years ago

rm-code commented 6 years ago

sb-exec seems to produce an error at the startup of Atom Editor if I have the following content in my .bash_profile:

function foo() {
    ~/bar "$@"
}
export -f foo

txtblu='\e[0;34m'
txtpur='\e[0;35m'
txtrst='\e[0m'   

printf "\n$txtblu%s @ $txtblu%s $txtpur%s\n$txtrst" "$USER" "$PWD"

I originally thought it was a problem with AtomLinter, but was forwarded to the exec repository instead. The error log comes from Atom Editor, so I'm not sure if it actually helps:

[Linter] Error running Luacheck Error: /bin/sh: foo: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `foo'
    at ChildProcess.<anonymous> (/Users/robert/.atom/packages/linter-luacheck/node_modules/sb-exec/lib/index.js:56)
    at emitTwo (events.js:126)
    at ChildProcess.emit (events.js:214)
    at maybeClose (internal/child_process.js:925)
    at Socket.stream.socket.on (internal/child_process.js:346)
    at emitOne (events.js:116)
    at Socket.emit (events.js:211)
    at Pipe._handle.close [as _onclose] (net.js:554)