diff options
| author | Jiao, Joey <jiangenj@qti.qualcomm.com> | 2025-04-07 13:24:37 +0800 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-04-08 09:56:29 +0000 |
| commit | 306cca2fec2d3d3d1e4c15bd5b40638e743227a1 (patch) | |
| tree | d42cf117df206028cd8e41acb6a9f08ecdc15613 /vm | |
| parent | a775275df40273d33a6577bc007a34087da9f056 (diff) | |
vm/adb: run script allows executing complex script
Diffstat (limited to 'vm')
| -rw-r--r-- | vm/adb/adb.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 77b0a8c55..ac93bc292 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -424,13 +424,7 @@ func (inst *instance) repair() error { func (inst *instance) runScript(script string) error { log.Logf(2, "adb: executing %s", script) - // Execute the contents of the script. - contents, err := os.ReadFile(script) - if err != nil { - return fmt.Errorf("unable to read %s: %w", script, err) - } - c := string(contents) - output, err := osutil.RunCmd(5*time.Minute, "", "sh", "-c", c) + output, err := osutil.RunCmd(5*time.Minute, "", "sh", script) if err != nil { return fmt.Errorf("failed to execute %s: %w", script, err) } |
