mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
Allow vars in dotenv paths, including environment variables
Closes #453 Closes #434 Ref #433 Co-authored-by: Andrey Nering <andrey@nering.com.br>
This commit is contained in:
committed by
Andrey Nering
parent
cded9af90f
commit
08265ed1d7
38
task_test.go
38
task_test.go
@@ -904,6 +904,44 @@ func TestDotenvShouldAllowMissingEnv(t *testing.T) {
|
||||
tt.Run(t)
|
||||
}
|
||||
|
||||
func TestDotenvHasLocalEnvInPath(t *testing.T) {
|
||||
tt := fileContentTest{
|
||||
Dir: "testdata/dotenv/local_env_in_path",
|
||||
Target: "default",
|
||||
TrimSpace: false,
|
||||
Files: map[string]string{
|
||||
"var.txt": "VAR='var_in_dot_env_1'\n",
|
||||
},
|
||||
}
|
||||
tt.Run(t)
|
||||
}
|
||||
|
||||
func TestDotenvHasLocalVarInPath(t *testing.T) {
|
||||
tt := fileContentTest{
|
||||
Dir: "testdata/dotenv/local_var_in_path",
|
||||
Target: "default",
|
||||
TrimSpace: false,
|
||||
Files: map[string]string{
|
||||
"var.txt": "VAR='var_in_dot_env_3'\n",
|
||||
},
|
||||
}
|
||||
tt.Run(t)
|
||||
}
|
||||
|
||||
func TestDotenvHasEnvVarInPath(t *testing.T) {
|
||||
os.Setenv("ENV_VAR", "testing")
|
||||
|
||||
tt := fileContentTest{
|
||||
Dir: "testdata/dotenv/env_var_in_path",
|
||||
Target: "default",
|
||||
TrimSpace: false,
|
||||
Files: map[string]string{
|
||||
"var.txt": "VAR='var_in_dot_env_2'\n",
|
||||
},
|
||||
}
|
||||
tt.Run(t)
|
||||
}
|
||||
|
||||
func TestExitImmediately(t *testing.T) {
|
||||
const dir = "testdata/exit_immediately"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user