Kintyre / ksconf

Kintyre's Splunk Configuration tool
Apache License 2.0
50 stars 13 forks source link

Enable capturing of stdout/stderror #86

Open lowell80 opened 3 years ago

lowell80 commented 3 years ago

Describe the solution you'd like

The builder.Step.run() function should support passing back values from stdout/stderror where possible. Maybe this could be a new function that supports capturing output, but currently nothing is returned by run().

Describe alternatives you've considered

Could call subprocess.Process() directly, but that seems counter-productive.

Example use case

Attempting to translate the following from my build script:

# Get commit time of savedsearches.conf (last time it changed; any stanza) and use that as the modtime
ss_mtime=$(git log -n 1 --pretty=format:%ct -- $APP/default/savedsearches.conf)
echo -e "[savedsearches/my_important_savedsearch]\n#Last change in git\nmodtime = $ss_mtime\n" >> "$BUILD/metadata/default.meta"