initial version, can start a server that serves the diff, gen an html file in tmp and open it or generate it in a specific location
This commit is contained in:
commit
872d29f3e1
6 changed files with 2409 additions and 0 deletions
39
difftool.sh
Executable file
39
difftool.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
STATIC=""
|
||||
OUTFILE=""
|
||||
ARGS=()
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--static)
|
||||
STATIC="--static"
|
||||
shift
|
||||
;;
|
||||
--out)
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Error: --out requires a file path" >&2
|
||||
exit 1
|
||||
fi
|
||||
OUTFILE="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
ARGS+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${#ARGS[@]} -lt 3 ]; then
|
||||
echo "Usage: difftool.sh [--static] [--out <file>] <git-project-dir> <main branch> <feature branch> [port]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
node_args=("$script_dir/server.js")
|
||||
[ -n "$STATIC" ] && node_args+=("$STATIC")
|
||||
[ -n "$OUTFILE" ] && node_args+=("--out" "$OUTFILE")
|
||||
node_args+=("${ARGS[@]}")
|
||||
exec node "${node_args[@]}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue