-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtasks.sh
49 lines (40 loc) · 905 Bytes
/
tasks.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
#!/bin/bash
LIB_PATH=lib
ROOT_PATH=.
function formatToLF() {
find . ! -path './.git/**' \
! -path './node_modules/**' \
! -path './examples/real-bot-example/node_modules/**' \
! -path './website/node_modules/**' \
! -path './website/.docusaurus/**' \
-type f -exec dos2unix {} \;
}
function clear() {
echo "cleaning $1 folder..."
rm -rf $1
}
# Usage: clearAngBuild (Folder to clear) (path to build)
function clearAndBuild() {
clear $1
echo "building $2..."
tsc -p $2
}
function watch() {
if [ -n "$1" ]; then
echo "watching changes for $1"
cd $1
else
echo "watching changes for root dir"
fi
tsc -w
}
function clearAndWatch() {
clear $1
echo "watching for changes..."
watch;
}
case $1 in
"build") clearAndBuild $LIB_PATH $ROOT_PATH ;;
"watch") clearAndWatch $LIB_PATH $ROOT_PATH ;;
*) help $1 ;;
esac