docs: add NEWSTART.md and NEWSTART.llm.md capturing all governance, process, and blueprint for a clean repo restart
Some checks are pending
ci / test (push) Waiting to run
Some checks are pending
ci / test (push) Waiting to run
This commit is contained in:
40
scripts/toolwrap.sh
Executable file
40
scripts/toolwrap.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Quiet command wrapper:
|
||||
# - Runs the given command without emitting stdout/stderr to the console.
|
||||
# - On success: prints nothing; logs an optional one-line summary to tool.log.
|
||||
# - On failure: writes full stdout/stderr to tool.log and exits non-zero.
|
||||
|
||||
log_file="docs/devlog/tool.log"
|
||||
mkdir -p "$(dirname "$log_file")"
|
||||
|
||||
ts() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
||||
|
||||
cmd=("$@")
|
||||
|
||||
# Capture stdout/stderr
|
||||
out_file="$(mktemp)"
|
||||
err_file="$(mktemp)"
|
||||
rc=0
|
||||
|
||||
{"${cmd[@]}"} >"$out_file" 2>"$err_file" || rc=$?
|
||||
|
||||
if [ "$rc" -eq 0 ]; then
|
||||
echo "$(ts) SUCCESS: ${cmd[*]}" >> "$log_file"
|
||||
rm -f "$out_file" "$err_file"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
{
|
||||
echo "$(ts) FAILURE: ${cmd[*]}"
|
||||
echo "--- STDOUT ---"
|
||||
cat "$out_file"
|
||||
echo "--- STDERR ---"
|
||||
cat "$err_file"
|
||||
echo "--------------"
|
||||
} >> "$log_file"
|
||||
|
||||
rm -f "$out_file" "$err_file"
|
||||
exit "$rc"
|
||||
|
Reference in New Issue
Block a user