-
Notifications
You must be signed in to change notification settings - Fork 6
/
Taskfile.yml
46 lines (44 loc) · 1.32 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
46
version: '2'
tasks:
hello:
cmds:
- echo "hello world"
test:
cmds:
- echo " *** Running Coverage Tests ***"
- $(pwd)/scripts/test.sh
- echo " *** Completed *** "
silent: true
relocate:
cmds:
- echo " *** Relocating packages to {{.TARGET_PATH}} ***"
- task: replace-string
vars: {
SOURCE_STR: "{{.PACKAGE_NAME}}",
TARGET_STG: "{{.TARGET_PATH}}"
}
- task: replace-string
vars: {
SOURCE_STR: "{{.PROJECT_NAME}}",
TARGET_STG: "{{.TARGET_PROJECTNAME}}"
}
- echo " *** Completed *** "
silent: true
vars:
GITHUB: "github.com"
PROJECT_NAME_DIR:
sh: echo $(basename "$(dirname "$(pwd)")")
PROJECT_NAME:
sh: echo $(basename "$(pwd)" | sed -e 's/[\/&]/\\&/g')
PACKAGE_NAME:
sh: echo "{{.GITHUB}}/{{.PROJECT_NAME_DIR}}/{{.PROJECT_NAME}}" | sed -e 's/[\/&]/\\&/g'
TARGET_PATH:
sh: echo "{{.TARGET}}" | sed -e 's/[\/&]/\\&/g'
TARGET_PROJECTNAME:
sh: basename "dirname {{.TARGET_PATH}}" | sed -e 's/[\/&]/\\&/g'
preconditions:
- sh: "[ {{.TARGET}} != '' ]"
replace-string:
cmds:
- grep -rlI '{{.SOURCE_STR}}' --include=*.{go,json} ./ | xargs -I@ sed -i '' 's/{{.SOURCE_STR}}/{{.TARGET_STG}}/g' @
silent: true