-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·70 lines (59 loc) · 1.34 KB
/
run
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
65
66
67
68
69
70
#!/bin/bash
# Chercan TaskFile
# See https://github.com/adriancooney/Taskfile
# A Taskfile is a bash (or zsh etc.) script that follows
# a specific format. It's called Taskfile, sits in the root of your project
# (alongside your other project files) and contains the
# tasks to build your project.
function new {
FILENAME=$1
{
echo "class Page {"
echo " static title {\"Hello Chercán\"}"
echo " static content {\"My Content\"}"
printf " static date {\"%s\"}\n" "`date`"
echo "}"
echo "return Page"
} > "content/${FILENAME}.wren"
}
function new:adoc {
FILENAME=$1
mkdir -p "content/${FILENAME}"
touch "content/${FILENAME}/${FILENAME}.adoc"
{
echo "class Page {"
echo " static title {\"Hello Chercán\"}"
echo " static content {Asciidoc.read()}"
printf " static date {\"%s\"}\n" "`date`"
echo "}"
echo "return Page"
} > "content/${FILENAME}.wren"
}
function remove {
FILENAME=$1
rm -rf "content/${FILENAME}.wren"
rm -rf "content/${FILENAME}/"
}
function build {
make build
}
function build:adoc {
make a
}
function build:all {
make ba
}
function serve {
make serve
}
function help {
echo "$0 <task> <args>"
echo "Tasks:"
compgen -A function | cat -n
}
function default {
# Default task to execute
help
}
TIMEFORMAT="Task completed in %3lR"
time ${@:-default}