File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 27
27
28
28
set -euo pipefail
29
29
30
- version=0.0.15 # TODO integrate with releases.
30
+ version=0.0.16 # TODO integrate with releases.
31
31
32
32
settle_base=$( pwd)
33
33
Original file line number Diff line number Diff line change @@ -200,15 +200,18 @@ type Pkg struct {
200
200
}
201
201
202
202
func (p Pkg ) String () string {
203
- components := []string {fmt .Sprintf (`brew "%s"` , p .Name )}
203
+ var sb strings.Builder
204
+ sb .WriteString (fmt .Sprintf ("brew %q" , p .Name ))
204
205
if len (p .Args ) > 0 {
205
- components = append (components , ", args: [" )
206
+ sb .WriteString (", args: [" )
207
+ var arrayEntries []string
206
208
for _ , arg := range p .Args {
207
- components = append (components , fmt .Sprintf (`"%s"` , arg ))
209
+ arrayEntries = append (arrayEntries , fmt .Sprintf ("%q" , arg ))
208
210
}
209
- components = append (components , "]" )
211
+ sb .WriteString (strings .Join (arrayEntries , "," ))
212
+ sb .WriteString ("]" )
210
213
}
211
- return strings . Join ( components , "" )
214
+ return sb . String ( )
212
215
}
213
216
214
217
type Casks []Cask
You can’t perform that action at this time.
0 commit comments