Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ linters:
- goimports
- gofmt
- gofumpt
- misspell

linters-settings:
goimports:
Expand Down
12 changes: 6 additions & 6 deletions task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ func TestEnv(t *testing.T) {
Target: "default",
TrimSpace: false,
Files: map[string]string{
"local.txt": "GOOS='linux' GOARCH='amd64' CGO_ENABLED='0'\n",
"global.txt": "FOO='foo' BAR='overriden' BAZ='baz'\n",
"multiple_type.txt": "FOO='1' BAR='true' BAZ='1.1'\n",
"not-overriden.txt": "QUX='from_os'\n",
"local.txt": "GOOS='linux' GOARCH='amd64' CGO_ENABLED='0'\n",
"global.txt": "FOO='foo' BAR='overridden' BAZ='baz'\n",
"multiple_type.txt": "FOO='1' BAR='true' BAZ='1.1'\n",
"not-overridden.txt": "QUX='from_os'\n",
},
}
tt.Run(t)
t.Setenv("TASK_X_ENV_PRECEDENCE", "1")
experiments.EnvPrecedence = experiments.New("ENV_PRECEDENCE")
ttt := fileContentTest{
Dir: "testdata/env",
Target: "overriden",
Target: "overridden",
TrimSpace: false,
Files: map[string]string{
"overriden.txt": "QUX='from_taskfile'\n",
"overridden.txt": "QUX='from_taskfile'\n",
},
}
ttt.Run(t)
Expand Down
12 changes: 6 additions & 6 deletions testdata/env/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks:
cmds:
- task: local
- task: global
- task: not-overriden
- task: not-overridden
- task: multiple_type

local:
Expand All @@ -31,7 +31,7 @@ tasks:

global:
env:
BAR: overriden
BAR: overridden
cmds:
- echo "FOO='$FOO' BAR='$BAR' BAZ='$BAZ'" > global.txt

Expand All @@ -43,10 +43,10 @@ tasks:
cmds:
- echo "FOO='$FOO' BAR='$BAR' BAZ='$BAZ'" > multiple_type.txt

not-overriden:
not-overridden:
cmds:
- echo "QUX='$QUX'" > not-overriden.txt
- echo "QUX='$QUX'" > not-overridden.txt

overriden:
overridden:
cmds:
- echo "QUX='$QUX'" > overriden.txt
- echo "QUX='$QUX'" > overridden.txt
Loading