auto adjust code

This commit is contained in:
Christopher Homberger
2026-02-22 20:58:46 +01:00
parent 949a40c7a5
commit d187ac2fc1
86 changed files with 617 additions and 617 deletions

View File

@@ -161,9 +161,11 @@ func (e *Environment) exec(ctx context.Context, command []string, _ string, env
wd = e.ToContainerPath(e.Path)
}
envs := ""
var envsSb164 strings.Builder
for k, v := range env {
envs += shellquote.Join(k) + "=" + shellquote.Join(v) + " "
envsSb164.WriteString(shellquote.Join(k) + "=" + shellquote.Join(v) + " ")
}
envs += envsSb164.String()
return e.execRaw(ctx, "cd "+shellquote.Join(wd)+"\nenv "+envs+shellquote.Join(command...)+"\nexit $?")
}
@@ -224,7 +226,7 @@ func (e *Environment) GetContainerArchive(ctx context.Context, srcPath string) (
return e.HostEnvironment.GetContainerArchive(ctx, e.ToHostPath(srcPath))
}
func (e *Environment) GetRunnerContext(ctx context.Context) map[string]interface{} {
func (e *Environment) GetRunnerContext(ctx context.Context) map[string]any {
rctx := e.HostEnvironment.GetRunnerContext(ctx)
rctx["temp"] = e.ToContainerPath(e.TmpDir)
rctx["tool_cache"] = e.ToContainerPath(e.ToolCache)

View File

@@ -235,7 +235,7 @@ func ExecWithEnv(
func firstNonEmptyLine(outputs ...string) string {
for _, output := range outputs {
for _, line := range strings.Split(output, "\n") {
for line := range strings.SplitSeq(output, "\n") {
if line != "" {
return line
}
@@ -246,5 +246,5 @@ func firstNonEmptyLine(outputs ...string) string {
}
func (vm *VM) tartRunOutputPath() string {
return filepath.Join(os.TempDir(), fmt.Sprintf("%s-tart-run-output.log", vm.id))
return filepath.Join(os.TempDir(), vm.id+"-tart-run-output.log")
}