Class NaruSystemDirective

java.lang.Object
net.thevpc.naru.api.registry.NaruDirectiveBase
net.thevpc.naru.ext.tools.sh.NaruSystemDirective
All Implemented Interfaces:
NaruDirective

public class NaruSystemDirective extends NaruDirectiveBase
Runs a shell command whose text is the raw directive argument (no NCmdLine quoting). By default it captures the output, records everything in the model-visible history and publishes the exit code as the task env var lastExitCode (so script control-flow like /while can loop until a command succeeds). The option --save <var> additionally stores the trimmed captured output into the task env var var, so a script can compare it directly (/if calc42 == "42") without a shell pipe. Prefix the command with --no-grab to run it with the terminal's stdin/stdout attached instead (e.g. an interactive editor like vim): output is then not captured (lastExitCode is still published).
  • Constructor Details

    • NaruSystemDirective

      public NaruSystemDirective()