forked from adriancooney/Taskfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.template
executable file
·64 lines (48 loc) · 1.21 KB
/
Taskfile.template
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
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
PATH=/.bin:$PATH
ME="$0"
# Text Format Ansi Codes
BOLD="\e[1m"
UNDERLINE="\e[4m"
RED="\e[31m"
NORMAL="\e[0m"
# USER SETTINGS ###########################
EDITOR=nano
TASKFILE_TEMPLATE="/home/ ... /bin/Taskfile.template"
# STANDARD TASKS ##########################
function install {
echo -e "${RED}install task not implemented${NORMAL}"
}
function build {
echo -e "${RED}build task not implemented${NORMAL}"
}
function start {
echo -e "${RED}start task not implemented${NORMAL}"
}
function default {
help
}
function help {
echo -e "${BOLD}$0 <task> <args>${NORMAL}"
echo -e "${UNDERLINE}Tasks:${NORMAL}"
compgen -A function | cat -n
}
# HELPER TASKS ###########################
function edit {
echo "Syntax: $0 ${FUNCNAME[0]} [template]"
echo "Edit the actual Taskfile or the template using flag 'template'"
if [[ $# -eq 0 ]]; then
echo "edit Taskfile"
${EDITOR} "$0"
else
if [[ $1 -eq "template" ]]; then
echo "edit Taskfile template"
${EDITOR} "${TASKFILE_TEMPLATE}"
fi
fi
}
# USER TASKS #############################
# ... insert here ...
# Run
TIMEFORMAT="Task completed in %3lR"
time ${@:-default}