mirror of
https://github.com/clearlinux/graphene.git
synced 2026-08-20 12:45:57 +00:00
82caa0683d
Unlike /usr/bin/env which is a Posix standard, there is no guarentee that /bin/bash exists. This is the case for operating systems such as FreeBSD, NixOS and Guix. By using /usr/bin/env we also give the user the option to provide their own bash in a different path by setting the $PATH environemnt variable. Distributions usually provide their own packaging wrappers to fixup shebangs upon installation, however those are not convienent to use when developing in the source tree. See also other upstream discussions about the topic: - https://github.com/systemd/systemd/pull/5816
23 lines
798 B
Bash
Executable File
23 lines
798 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
# Intended to be run after a build. Returns 1 (i.e. failure) if there's at
|
|
# least one modified or untracked file which is not gitignored.
|
|
|
|
# Don't inline it in the if, since we want to exit on error return codes (set -e).
|
|
status="$(git status --porcelain)"
|
|
|
|
if [ -z "$status" ]; then
|
|
echo "No not-gitignored changes :]"
|
|
exit 0
|
|
fi
|
|
|
|
echo "================================================================================"
|
|
echo " ERROR: Files modified by build, but not gitignored:"
|
|
echo "--------------------------------------------------------------------------------"
|
|
echo "$status"
|
|
git submodule foreach --recursive git status --porcelain
|
|
echo "================================================================================"
|
|
exit 1
|