mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00

Finding small errors in `RunCMake` outputs against the output is a tedious task. Add a small tool that sets up a simple `tmux` window setup to help debug them.
29 lines
608 B
Bash
Executable File
29 lines
608 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
die () {
|
|
echo >&2 "$@"
|
|
exit 1
|
|
}
|
|
|
|
test -x "$( which tmux 2>/dev/null )" || die "\`tmux\` is required"
|
|
test -n "$TMUX" || die "must be running within a \`tmux\` session"
|
|
test -x "$( which watch )" || die "\`watch\` is required"
|
|
|
|
editor="${EDITOR:-nano}"
|
|
readonly editor
|
|
|
|
test -x "$( which "$EDITOR" )" || die "\`$editor\` is required"
|
|
|
|
tmux split-window -v -l 10 -c "$PWD" 'watch --interval 1 cmake -P match.cmake'
|
|
tmux select-pane -l
|
|
case "$editor" in
|
|
*vi*)
|
|
"$editor" re.txt content.txt -c 'vsp|bn'
|
|
;;
|
|
*)
|
|
"$editor" re.txt content.txt
|
|
;;
|
|
esac
|