-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtaskfile
executable file
·43 lines (36 loc) · 1.11 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
#!/bin/bash
PATH=./node_modules/.bin:$PATH
##########################################
# Publish NPM/Github Tags
##########################################
function _publish:check {
if output=$(git status --untracked-files=no --porcelain) && [ -z "$output" ]; then
# Working directory clean
echo "Ready to publish..."
else
red=`tput setaf 1`
reset=`tput sgr0`
echo " ${red}Git working directory not clean."
echo " Commit your changes and try again.${reset}"
exit 1
fi
}
function publish:major {
_publish:check
npm version major && npm publish && npm version patch && git push --tags && git push origin master
}
function publish:minor {
_publish:check
npm version minor && npm publish && npm version patch && git push --tags && git push origin master
}
function publish:patch {
_publish:check
npm version patch && npm publish && git push --tags && git push origin master
}
function help {
echo "$0 <task> <args>"
echo "Tasks:"
compgen -A function | grep -v '^_' | cat -n
}
TIMEFORMAT="Task completed in %3lR"
time ${@:-help}