-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·47 lines (33 loc) · 883 Bytes
/
package.sh
File metadata and controls
executable file
·47 lines (33 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -eEuo pipefail
trap 'printf "\n\e[31mError: Exit Status %s (%s)\e[m\n" $? "$(basename "$0")"' ERR
cd "$(dirname "$0")"
echo
echo "Start ($(basename "$0"))"
echo
echo "Packaging"
echo "= = ="
warning=0
for gemspec in $(find . -maxdepth 2 -name '*.gemspec'); do
echo
echo "Gem: $(basename "$gemspec")"
echo "- - -"
path="$(dirname "$gemspec")"
gem -C "$path" build --force "$(basename "$gemspec")"
done
if ! git diff --quiet; then
echo
printf "\e[31mWarning: There are local changes\e[m\n"
warning=1
fi
unpushed_commit_count=$(git rev-list origin/master.. --count)
if [ "$unpushed_commit_count" -ne 0 ]; then
echo
printf "\e[31mWarning: There are %d unpushed commits\e[m\n" "$unpushed_commit_count"
warning=1
fi
if [ "$warning" = 1 ] && [ "${PERMIT_WARNINGS:-}" != "on" ]; then
false
fi
echo
echo "Done ($(basename "$0"))"