Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tool/tsh/common/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,13 @@ func envVarDefaultFormat() string {
func envVarCommand(format, key, value string) (string, error) {
switch format {
case envVarFormatUnix:
return fmt.Sprintf("export %s=%s", key, value), nil
return fmt.Sprintf(`export %s="%s"`, key, value), nil

case envVarFormatWindowsCommandPrompt:
return fmt.Sprintf("set %s=%s", key, value), nil

case envVarFormatWindowsPowershell:
return fmt.Sprintf("$Env:%s=\"%s\"", key, value), nil
return fmt.Sprintf(`$Env:%s="%s"`, key, value), nil

case envVarFormatText:
return fmt.Sprintf("%s=%s", key, value), nil
Expand Down
4 changes: 2 additions & 2 deletions tool/tsh/common/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ func TestEnvVarCommand(t *testing.T) {
inputFormat: envVarFormatUnix,
inputKey: "key",
inputValue: "value",
expectOutput: "export key=value",
expectOutput: `export key="value"`,
},
{
inputFormat: envVarFormatWindowsCommandPrompt,
Expand All @@ -849,7 +849,7 @@ func TestEnvVarCommand(t *testing.T) {
inputFormat: envVarFormatWindowsPowershell,
inputKey: "key",
inputValue: "value",
expectOutput: "$Env:key=\"value\"",
expectOutput: `$Env:key="value"`,
},
{
inputFormat: "unknown",
Expand Down