-
Notifications
You must be signed in to change notification settings - Fork 9
/
project
executable file
·79 lines (70 loc) · 1.2 KB
/
project
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
declare -r project="specdris.ipkg"
declare -r test="test.ipkg"
clean()
{
echo "clean project"
idris --clean ${project}
cd test; idris --clean ${test}; cd ..
}
test()
{
echo "test project"
cd test
idris --testpkg ${test}
if [[ $? -eq 0 ]]; then
echo "SUCCESSFUL"
else
echo "FAILURE"
exit 1
fi
cd ..
}
buildNoTest()
{
echo "build project"
idris --build ${project}
}
build()
{
buildNoTest
test
}
install()
{
echo "install project"
clean
test
if [[ $? -eq 0 ]]; then
idris --install ${project}
else
echo "couldn't install project > something went wrong"
exit 1
fi
}
case $1 in
"--clean")
clean
;;
"--build")
build
;;
"--buildNoTest")
buildNoTest
;;
"--test")
test
;;
"--install")
install
;;
"--help")
echo "usage: './project [command]'"
echo " --clean: cleans the project"
echo " --build: builds the code and runs all tests"
echo " --test: runs all tests"
;;
*)
echo "unknown command, use '--help' for help"
;;
esac