forked from carp-lang/Carp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·59 lines (45 loc) · 1.11 KB
/
release.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/bash
set -e;
name=$1
if [ "$name" == "" ]; then
echo "ERROR: Must pass a name of the release as the first argument to this script.";
exit 1;
fi
fullPath="$PWD/releases/$name"
echo "Creating release '$name'"
echo "Full path = '$fullPath'"
echo "Continue? (y/n)"
read answer
if [ "$answer" != "y" ]; then
echo "Bye!"
exit 1;
fi
mkdir -p "$fullPath"
echo
echo "Building Haskell project..."
stack build
carpExePath="$(which carp)"
if [ "$carpExePath" == "" ]; then
echo "ERROR: Can't find the carp executable on your system.";
exit 1;
fi
echo "Path of Carp executable = '$carpExePath'"
mkdir "$fullPath/bin"
echo "Copying executable..."
cp $carpExePath "$fullPath/bin/carp"
echo "Copying core..."
cp -r "./core/" "$fullPath/core/"
echo "Copying docs..."
cp -r "./docs/" "$fullPath/docs/"
echo "Copying README.md..."
cp -r "./README.md" "$fullPath/README.md"
echo "Copying img..."
cp -r "./img/" "$fullPath/img/"
echo "Copying examples..."
cp -r "./examples/" "$fullPath/examples/"
echo
echo "Zipping..."
cd releases
zip -r "${name}.zip" "${name}"
echo
echo "Done. New release created successfully!"