diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-04 21:11:20 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-04 21:11:20 +0700 |
| commit | 858c26d3d940e3fba2db4ee1c6a3bb4b54544cf9 (patch) | |
| tree | 308d0e25c9b072f857f04dce9403a848b9d6faf2 | |
| parent | aa467a4ed1fc554871be27ca303ee6ffc14b92c8 (diff) | |
| download | awwan-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.go | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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) |
