Skip to content
Open
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
6 changes: 6 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ func needsQuote(s string) bool {
return true
}

// if the string starts and ends with quotes, it is already quoted
if strings.HasPrefix(s, "\"") && strings.HasSuffix(s, "\"") ||
strings.HasPrefix(s, "'") && strings.HasSuffix(s, "'") {
return false
}

// lexer should throw an error when variable expansion syntax
// is messed up, but just wrap it in quotes for now I guess
var char rune
Expand Down