Skip to content

Commit d029859

Browse files
committed
vm/adb: run script allows executing complex script
1 parent 1c65791 commit d029859

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

vm/adb/adb.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,7 @@ func (inst *instance) repair() error {
424424

425425
func (inst *instance) runScript(script string) error {
426426
log.Logf(2, "adb: executing %s", script)
427-
// Execute the contents of the script.
428-
contents, err := os.ReadFile(script)
429-
if err != nil {
430-
return fmt.Errorf("unable to read %s: %w", script, err)
431-
}
432-
c := string(contents)
433-
output, err := osutil.RunCmd(5*time.Minute, "", "sh", "-c", c)
427+
output, err := osutil.RunCmd(5*time.Minute, "", "sh", script)
434428
if err != nil {
435429
return fmt.Errorf("failed to execute %s: %w", script, err)
436430
}

0 commit comments

Comments
 (0)