Skip to content

Commit 92a89a5

Browse files
committed
fix(tasks): remove os.Expand from native runner
- os.Expand was destroying all shell variables () inside native scripts defined in .unirtm.toml. - Let the shell handle its own variables natively, as UniRTM env vars are already injected into cmd.Env.
1 parent 7544bec commit 92a89a5

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

internal/task/native.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,7 @@ func (r *NativeRunner) runTaskWithGraph(ctx context.Context, dir string, taskNam
8484
script = script + " " + strings.Join(args, " ")
8585
}
8686

87-
// Apply shell-style expansion to the script
88-
envMap := make(map[string]string)
89-
for _, e := range os.Environ() {
90-
parts := strings.SplitN(e, "=", 2)
91-
if len(parts) == 2 {
92-
envMap[parts[0]] = parts[1]
93-
}
94-
}
95-
// Overlay UniRTM resolved env
96-
for _, e := range env {
97-
parts := strings.SplitN(e, "=", 2)
98-
if len(parts) == 2 {
99-
envMap[parts[0]] = parts[1]
100-
}
101-
}
102-
script = os.Expand(script, func(k string) string {
103-
return envMap[k]
104-
})
87+
10588

10689
// Resolve timeout: task override > global setting
10790
timeout := r.settings.TaskTimeout

0 commit comments

Comments
 (0)