-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
46 lines (40 loc) · 1.18 KB
/
Taskfile.yml
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
version: '3'
tasks:
help:
silent: true
desc: "Show help"
cmds:
- |
echo "Usage: task [task]"
echo ""
echo "Tasks:"
echo " init - Initialize a new devlocal environment"
echo " name=[name] - Name of the environment e.g. devlocal-mymac"
echo " description='[description]' - Description of the environment"
echo " help - Show help"
init:
silent: true
desc: "Initialize a new devlocal environment"
inputs:
- name: name
desc: "Name of the environment e.g. devlocal-mymac"
- name: description
desc: "Description of the environment"
cmds:
- |
name="{{.name}}"
description="{{.description}}"
# Check if `name` is provided
if [ -z "$name" ]; then
echo "name is required"
exit 1
fi
# Create `name` folder as a new project
# Throw error if folder already exists
if [ -d "$name" ]; then
echo "Project already exists"
exit 1
else
mkdir {{.USER_WORKING_DIR}}/$name
fi
cp -r "{{.TASKFILE_DIR}}/boiler/." "{{.USER_WORKING_DIR}}/$name/"