Skip to content

Commit

Permalink
don't strip spaces from multiline script block #122
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Jun 12, 2023
1 parent d92d243 commit 4e14334
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/config/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (cmd *Cmd) scriptFile(inp string) (r io.Reader) {
exports := []string{} // we collect them all here to pass as setenv to the next command
elems := strings.Split(inp, "\n")
for _, el := range elems {
c := strings.TrimSpace(el)
c := el
if len(c) < 2 {
continue
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ echo 'Goodbye, World!'`,
Script: `echo 'Hello, World!'
export FOO='bar'
echo 'Goodbye, World!'
echo "with space"
export BAR='foo'
`,
},
Expand All @@ -56,6 +57,7 @@ export BAR='foo'
"echo 'Hello, World!'",
"export FOO='bar'",
"echo 'Goodbye, World!'",
" echo \"with space\"",
"export BAR='foo'",
"echo setvar FOO=${FOO}",
"echo setvar BAR=${BAR}",
Expand Down
2 changes: 1 addition & 1 deletion spot.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "SPOT" 1 v1.8.0 20230612T153822 spot manual
.TH "SPOT" 1 v1.8.1 20230612T163822 spot manual
.\" Automatically generated by Pandoc 3.1.2
.\"
.\" Define V font for inline verbatim, using C font in formats
Expand Down

0 comments on commit 4e14334

Please sign in to comment.