Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
62 lines (51 loc) · 1.37 KB

File metadata and controls

62 lines (51 loc) · 1.37 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# Hook script to validate rules and check locales before accepting
# pushed changes on the server side.
# See http://stackoverflow.com/questions/4541417/how-can-i-make-it-so-git-rejects-pushing-code-that-wont-compile
#
# By default, this should run in the root of the git repository.
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
# --- Safety check
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
echo " (if you want, you could supply GIT_DIR then run" >&2
echo " $0 <ref> <oldrev> <newrev>)" >&2
exit 1
fi
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
exit 1
fi
# --- Copy the state of the repository as of the new pushed code
maindir=$(git rev-parse --show-toplevel)
cd "$maindir"
copydir="./tmp/git_hook_compile_copy"
echo "making copy of $newrev to $copydir" >&2
rm -rf "$copydir"
mkdir "$copydir"
git archive $newrev | tar -x -C $copydir/
if [ "$?" != "0" ]; then
echo "*** unable to make copy of code" >&2
exit 1
fi
echo "attempting to validate $newrev" >&2
# --- Test build
if [ -f makexpi.sh && -f makecrx.sh ]; then
./makexpi.sh
XPIBULID=$?
./makecrx.sh
CRXBUILD=$?
if [ "$XPIBULID" != 0 || "$CRXBUILD" != 0 ]; then
echo "*** build failed" >&2
exit 1
else
exit 0
fi
else
echo "*** could not find makexpi.sh or makecrx.sh." >&2
exit 1
fi
Morty Proxy This is a proxified and sanitized view of the page, visit original site.