Skip to content

Commit 2b3397b

Browse files
committed
chore: improve taskfile
1 parent fda9c3a commit 2b3397b

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

shared-files/taskfile/libraries/golang.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tasks:
3939
init:
4040
desc: Initialize the golang
4141
silent: true
42+
internal: true
4243
cmds:
4344
- defer: "echo ✅ Golang are initialized"
4445

shared-files/taskfile/libraries/internal.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version: "3"
44
tasks:
55
tools:brew:
66
desc: brew install
7+
internal: true
78
silent: true
89
preconditions:
910
- sh: command -v brew
@@ -17,6 +18,7 @@ tasks:
1718
1819
tools:brew:optional:
1920
desc: brew install
21+
internal: true
2022
silent: true
2123
preconditions:
2224
- sh: command -v brew
@@ -32,6 +34,7 @@ tasks:
3234
3335
tools:brew:tap:
3436
desc: brew tap
37+
internal: true
3538
silent: true
3639
preconditions:
3740
- sh: command -v brew

shared-files/taskfile/libraries/license.yml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ tasks:
2929
init:
3030
desc: Initialize the license
3131
silent: true
32+
internal: true
3233
cmds:
3334
- defer: echo "✅ License are initialized"
3435

shared-files/taskfile/libraries/pre-commit.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tasks:
99
lint:
1010
desc: Run pre-commit linters
1111
silent: true
12+
internal: true
1213
cmds:
1314
- echo "🚧 No linters available for pre-commit"
1415

@@ -23,6 +24,7 @@ tasks:
2324
cmds:
2425
- defer: echo "✅ Pre-commit are initialized"
2526
- pre-commit install
27+
- pre-commit install --install-hooks
2628

2729
install:
2830
desc: Install required tools

shared-files/taskfile/libraries/terraform.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ vars:
55
IS_MODULE:
66
# The pattern of terraform module name is terraform-cloudavenue-<nameofmodule>.
77
# Detect if it's a module with the presence of the terraform-cloudavenue- keyword in the last part of the path
8-
sh: awk -F/ '{print $NF}' <<< $(pwd) | grep -q "terraform-cloudavenue-" && echo "true" || echo "false"
8+
sh: |
9+
if [[ $IS_MODULE == "" ]]; then
10+
awk -F/ '{print $NF}' <<< $(pwd) | grep -q "terraform-cloudavenue-" && echo "true" || echo "false"
11+
else
12+
echo $IS_MODULE
13+
fi
914
1015
includes:
1116
internal: internal.yml
@@ -15,6 +20,7 @@ tasks:
1520
init:
1621
desc: Initialize the terraform
1722
silent: true
23+
internal: true
1824
cmds:
1925
- defer: "echo ✅ Terraform are initialized"
2026
- cmd: terraform init

0 commit comments

Comments
 (0)