From 858c26d3d940e3fba2db4ee1c6a3bb4b54544cf9 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 4 Sep 2023 21:11:20 +0700 Subject: all: do not expand environment during parseScript Environment variables in the script may only expanded by shell on remote not always on local. --- script.go | 7 +------ 1 file changed, 1 insertion(+), 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) -- cgit v1.3