-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpre-commit.sh
59 lines (39 loc) · 886 Bytes
/
pre-commit.sh
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
#!/bin/sh
exec < /dev/tty
function buildRefs {
echo "Building refs...";
echo "> git stash -q --keep-index";
git stash -q --keep-index
echo "> npm run vt:refs";
npm run vt:refs
echo "> git stash pop -q"
git stash pop -q
}
function compareRefs {
echo "Comparing refs...";
echo "> npm run vt:compare";
npm run vt:compare
}
function lastContinue {
echo "";
read -p "Continue? (y/n)" CONTINUE
if [ "$CONTINUE" == "n" ]; then
exit 1;
fi
}
# Lint SCSS files
echo "Linting SCSS files...";
npm run lint || { echo '\n> Please check lint error(s)!' ; exit 1; }
echo ""
read -p "Continue? (y/n)" CONTINUE_AFTER_LINT
if [ "$CONTINUE_AFTER_LINT" == "n" ]; then
exit 1;
fi
# Build and compare refs
#echo "";
#read -p "Build and compare refs? (y/n)" COMPARE_REFS
#if [ "$COMPARE_REFS" == "y" ]; then
# buildRefs
# compareRefs
# lastContinue
#fi