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
6
6
# # Sanity Checks ##
7
7
# ##################
8
8
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
+ #
9
23
# GUIX_BUILD_OPTIONS is an environment variable recognized by guix commands that
10
24
# can perform builds. This seems like what we want instead of
11
25
# ADDITIONAL_GUIX_COMMON_FLAGS, but the value of GUIX_BUILD_OPTIONS is actually
30
44
exit 1
31
45
fi
32
46
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
+
33
67
# ########
34
68
# Setup #
35
69
# ########
You can’t perform that action at this time.
0 commit comments