juxt / mach

A remake of make (in ClojureScript)
246 stars 21 forks source link

Cannot use output of `sh` to detect novelty #29

Closed bhb closed 7 years ago

bhb commented 7 years ago

I may be misunderstanding something, but I would expect that I could call a command via sh and then use the stdout to detect novelty (my use case is using git to detect if a submodule is out of date).

However, in my testing, I can't seem to get the value of stdout after running a command.

Version: juxt/mach@1.4.0

I've got a toy example below where I just try to print out the value of an echo.

Machfile.edn:

{
 example/example1 {novelty (do
                             (prn "result is:" (mach.core/sh ["echo" "hello"]))
                             false
                             )}

 }

Expected: The return value of sh is the value of standard out from running the "echo" command. Actual: The return value of sh is nil.

jonpither commented 7 years ago

Thanks for raising - we've been battling the best way to solve this given the async nature of the node spawn process call. We have a fix that is in 1.4.1 that should work for you.

bhb commented 7 years ago

@jonpither Thanks for the fast turnaround on this fix!