-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.taskfile
executable file
·46 lines (37 loc) · 1.15 KB
/
.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
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -e
function eachPackageDo() {
cd packages
for fold in */; do
cd $fold
$1
cd ..
done
cd ..
}
function clean() {
rm -rf dist
eachPackageDo "rm -rf dist"
}
function run_test() {
declare -a testFolders=(common react react-native react-typescript ts-compiler)
cd packages
for fold in "${testFolders[@]}"; do
cd $fold
npm run test:hero
cd ..
done
}
function post_install() {
eachPackageDo "npm i"
}
function print_tsconfig() {
result=$(node -e 'console.log(JSON.stringify(require("./packages/ts-compiler/dist/src/tsconfig.js").getTSConfig(false, {})))' | jq .)
printf "### Default Configuration used in capsule\n \`\`\`js\n $result\n \`\`\` \n" > packages/ts-compiler/config.md
}
function print_react_native_tsconfig() {
result=$(node -e 'console.log(JSON.stringify(require("./packages/react-native-typescript/dist/src/tsconfig.js").getTSConfig(true, {})))' | jq .)
printf "### Default Configuration used in capsule\n \`\`\`js\n $result\n \`\`\` \n" > packages/react-native-typescript/config.md
}
TIMEFORMAT="Task completed in %3lR"
time ${@:-default}