Files
oysteikt 3204fa60f3
Evaluate machine configurations / eval (kasei) (push) Successful in 2m16s
Evaluate machine configurations / eval (tsuki) (push) Successful in 2m45s
Evaluate machine configurations / eval (xps16) (push) Successful in 3m57s
home/git: add addr command
2026-06-05 16:22:20 +09:00

20 lines
368 B
Bash

GIT_ROOT_DIR="$(git rev-parse --show-toplevel)"
if [ "$GIT_ROOT_DIR" = "" ]; then
echo "Not a git repository"
exit 1
fi
# Transform all file args to prepend the git root dir
declare -a FINAL_ARGS
for i in "$@"; do
if [ -f "$GIT_ROOT_DIR/$i" ]; then
FINAL_ARGS+=("$GIT_ROOT_DIR/$i")
else
FINAL_ARGS+=("$i")
fi
done
exec git add "${FINAL_ARGS[@]}"