Running Node (or any unix cmd line program) from Shell from a LC Stack
hh at hh.on-rev.com
Mon May 9 23:01:51 CEST 2016
David B. wrote
> Yes - here is the handler you need:
> command bash_AddSystemPathsToPATH
> if the platform = "MacOS" then -- and it is recent ???
> put url "file:/etc/paths" into systemPaths
> put token 1 to -1 of systemPaths into systemPathArray
> put $PATH into revPATH
> replace ":" with CR in revPATH
> put systemPathArray & CR & revPATH into combinedPath
> sort combinedPath
> put token 1 to -1 of combinedPath into combinedPath
> split combinedPath with CR and ":"
> put keys (combinedPath) into newPathIndex
> replace CR with ":" in newPathIndex
> put newPathIndex into $PATH
> end if
> return $PATH
> end bash_AddSystemPathsToPATH
> You want to use the above script on startup to automatically
> configure your $PATH in Livecode for things like "brew" and npm.
But who knows to which file Apple's launchctl writes environments vars?
And who knows which 'path-file' LC uses at startup for it's $PATH?
So I would like to propose *moreover* to ensure that /usr/local/bin
is added to $PATH ( I have here the paths:
/usr/local/bin/brew and /usr/local/bin/npm )
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Running-Node-or-any-unix-cmd-line-program-from-Shell-from-a-LC-Stack-tp4704464p4704487.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode