-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmash
executable file
·51 lines (45 loc) · 1015 Bytes
/
mash
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
#!/usr/bin/env bash
set -ueo pipefail
dateTime(){ date -u '+%Y-%m-%dT%H:%M:%SZ'; }
rundir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
cd "$rundir"
# {make.sh user}
run:build:docs () {
yarn build:docs:html
cd docs/pages
git init -b docco
git add .
git commit -m docco
git remote add origin https://github.com/mhio/pinky
git push --force --set-upstream origin docco
}
run:watch () {
nodemon -e sh,ts,json -i .git -x "$@"
}
run:test:50 () {
i=0;
while yarn test; do
let i=i+1;
if [ $i -gt 50 ]; then
echo "done 50"
break
fi
done
}
# {make.sh common}
run:completion:words(){
declare -F | while read -r line; do
[ "${line:11:4}" = "run:" ] && [ "${line:11:15}" != "run:completion:" ] && echo "${line:15}"
done
}
run:help(){
set +x
echo "Commands:"
run:completion:words | while read -r line; do printf " %s\n" "${line}"; done
exit 1
}
[ -z "${1:-}" ] && run:help
cmd="$1"
shift
[[ "$cmd" == completion:* ]] || set -x
run:"$cmd" "$@"