Files
coder/scripts/check_unstaged.sh
T
Kyle Carberry e490bdd531 revert: Makefile buff-ification (#3700) (#3848)
This caused the following issues:
- Slim binaries weren't being updated.
- The coder.tar.ztd was misplaced.
- There is no coder.sha1 file with proper filenames.

This should be reintroduced in a future change with those fixes.
2022-09-02 14:46:58 -05:00

31 lines
552 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
(
cd "${PROJECT_ROOT}"
FILES="$(git ls-files --other --modified --exclude-standard)"
if [[ "$FILES" != "" ]]; then
mapfile -t files <<<"$FILES"
echo "The following files contain unstaged changes:"
echo
for file in "${files[@]}"; do
echo " - $file"
done
echo
echo "These are the changes:"
echo
for file in "${files[@]}"; do
git --no-pager diff "$file"
done
exit 1
fi
)
exit 0