File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,20 @@ set -e -o pipefail
66# # Sanity Checks ##
77# ##################
88
9+ # ###############
10+ # Check 1: Make sure that we can invoke required tools
11+ # ###############
12+ for cmd in git make guix cat mkdir; do
13+ if ! command -v " $cmd " > /dev/null 2>&1 ; then
14+ echo " ERR: This script requires that '$cmd ' is installed and available in your \$ PATH"
15+ exit 1
16+ fi
17+ done
18+
19+ # ###############
20+ # Check 2: Make sure GUIX_BUILD_OPTIONS is empty
21+ # ###############
22+ #
923# GUIX_BUILD_OPTIONS is an environment variable recognized by guix commands that
1024# can perform builds. This seems like what we want instead of
1125# ADDITIONAL_GUIX_COMMON_FLAGS, but the value of GUIX_BUILD_OPTIONS is actually
3044exit 1
3145fi
3246
47+ # ###############
48+ # Check 3: Make sure that we're not in a dirty worktree
49+ # ###############
50+ if ! git diff-index --quiet HEAD -- && [ -z " $FORCE_DIRTY_WORKTREE " ]; then
51+ cat << EOF
52+ ERR: The current git worktree is dirty, which may lead to broken builds.
53+
54+ Aborting...
55+
56+ Hint: To make your git worktree clean, You may want to:
57+ 1. Commit your changes,
58+ 2. Stash your changes, or
59+ 3. Set the 'FORCE_DIRTY_WORKTREE' environment variable if you insist on
60+ using a dirty worktree
61+ EOF
62+ exit 1
63+ else
64+ GIT_COMMIT=$( git rev-parse --short=12 HEAD)
65+ fi
66+
3367# ########
3468# Setup #
3569# ########
You can’t perform that action at this time.
0 commit comments