summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-04 21:11:20 +0700
committerShulhan <ms@kilabit.info>2023-09-04 21:11:20 +0700
commit858c26d3d940e3fba2db4ee1c6a3bb4b54544cf9 (patch)
tree308d0e25c9b072f857f04dce9403a848b9d6faf2
parentaa467a4ed1fc554871be27ca303ee6ffc14b92c8 (diff)
downloadawwan-858c26d3d940e3fba2db4ee1c6a3bb4b54544cf9.tar.xz
all: do not expand environment during parseScript
Environment variables in the script may only expanded by shell on remote not always on local.
-rw-r--r--script.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/script.go b/script.go
index 3e2a380..74840fc 100644
--- a/script.go
+++ b/script.go
@@ -100,12 +100,7 @@ func parseScript(ses *Session, content []byte, isLocal bool) (script *Script, er
return nil, fmt.Errorf("%s: %w", logp, err)
}
- if isLocal {
- // Apply the environment variables into script content.
- raw = []byte(os.ExpandEnv(buf.String()))
- } else {
- raw = buf.Bytes()
- }
+ raw = buf.Bytes()
raw = bytes.TrimRight(raw, " \t\r\n\v")
splits = bytes.Split(raw, newLine)