-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile
More file actions
37 lines (33 loc) · 765 Bytes
/
Taskfile
File metadata and controls
37 lines (33 loc) · 765 Bytes
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
#!/bin/bash
PATH="$PWD/node_modules/.bin":$PATH
set -e
build() {
set -x
rm -rfv dist
cp -rfv src dist
cat tsconfig.json | jq 'del(.include, .compilerOptions.outDir)' > dist/tsconfig.json
cp -v README.md package.json dist
cd dist
/usr/bin/find . -name '*.spec.ts' | xargs rm -rvf
tsc -p .
rm -rvf tsconfig.json
cd ..
set +x
}
git_last_release_tag() {
result=""
rev=$(git rev-list --max-count=1 --tags="v[0-9]*\\.[0-9]*\\.[0-9]*")
if [ -n "$rev" ]; then
result=$(git describe --tags $rev)
fi
if [ -n "$result" ]; then
result=$(git rev-list --max-parents=0 HEAD)
fi
echo $result
}
commit_lint() {
set -x
from=$(git_last_release_tag)
commitlint --from $from
}
"$@"