automaton-build.os.cmds

Execute commands.

blocking-cmd

(blocking-cmd cmd dir)

Returns a map with execution blocking-cmd of the blocking command cmd execution. Use this flavor when you need to wait for the end of the execution and have the exit code and outputs (out and err).

blocking-cmd-str

(blocking-cmd-str cmd-str dir)

Returns a map with execution blocking-cmd of the blocking command cmd-str execution. Use this flavor when you need to wait for the end of the execution and have the exit code and outputs (out and err).

chain-cmds

(chain-cmds cmd-chain)

Execute all commands in the chain, stops at the first failing one.

clj-parameterize

(clj-parameterize par)

Turns par into a parameter understood by a clojure cli.

create-process

(create-process cmd dir)

Create a process executed in directory dir and based on command string cmd-str.

Returns a process.

create-process-str

(create-process-str cmd-str dir)

Create a process executed in directory dir and based on command string cmd-str.

Returns a process.

defaulting-dir

(defaulting-dir dir)

exec

(exec process)

first-failing

(first-failing chain-res)

Returns the result of the first failing result of a command, or the last succesful one.

force-dirs

(force-dirs cmd-chain dir)

Update a chain so all element of the chain are executed in the same dir

kill

(kill proc)

Kill the running process proc.

log-stream

(log-stream proc stream-kw on-line-fn on-end-fn refresh-delay error-fn)

Apply logger-fn to each line of the stream called stream-kw of the proc. When the proc is not alive. refresh-delay pauses between two attempts of refreshing the log. If an error occur, use error-fn to display it.

schema

simple-shell

(simple-shell cmd args)

Simple shell. Use this one when you need to leverage standard input/output for the command called.

success

(success result)

Returns true if the result is a success

to-str

(to-str cmd)