1
0
mirror of https://github.com/go-task/task.git synced 2025-09-16 09:26:16 +02:00

fix: add changelog + fix for booleans for #1641

This commit is contained in:
Andrey Nering
2024-05-09 11:21:12 -03:00
parent 3397f2855f
commit bfc9d7847d
3 changed files with 7 additions and 2 deletions

View File

@@ -1,5 +1,10 @@
# Changelog
## Unreleased
- Fix bug where non-string values (numbers, bools) added to `env:` weren't been
correctly exported (#1640, #1641 by @vmaerten and @andreynering).
## v3.37.0 - 2024-05-08
- Released the

2
internal/env/env.go vendored
View File

@@ -29,7 +29,7 @@ func Get(t *ast.Task) []string {
func isTypeAllowed(v any) bool {
switch v.(type) {
case string, int, float32, float64:
case string, bool, int, float32, float64:
return true
default:
return false

View File

@@ -103,7 +103,7 @@ func TestEnv(t *testing.T) {
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='' BAZ='1.1'\n",
"multiple_type.txt": "FOO='1' BAR='true' BAZ='1.1'\n",
},
}
tt.Run(t)