Files
EventHubBack/scripts/git-commit.sh
T

19 lines
413 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Обход: Agent Shell ломает "git commit" в PowerShell (trailer с <).
# Вызов: bash scripts/git-commit.sh "message" [paths...]
set -euo pipefail
if [ $# -lt 2 ]; then
echo "Usage: git-commit.sh \"message\" <paths...>" >&2
exit 1
fi
MSG=$1
shift
REPO_ROOT=$(cd "$(dirname "$0")/.." && pwd)
cd "$REPO_ROOT"
git add "$@"
/usr/bin/git commit -m "$MSG"
git log -1 --oneline