forked from nestjs/typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTaskfile
37 lines (33 loc) · 807 Bytes
/
Taskfile
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
npm run prisma:generate
rm -rf dist
mkdir dist
nest build
mkdir -p dist/prisma/migrations
cp -r prisma/migrations/* dist/prisma/migrations
cp prisma/schema.prisma dist/prisma
mkdir -p dist/node_modules/@prisma/client
cp -r node_modules/@prisma/client/* dist/node_modules/@prisma/client
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
}
"$@"