2014-08-15 12:29:35 -04:00
|
|
|
package builder
|
2014-08-05 16:17:40 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2014-08-13 06:07:41 -04:00
|
|
|
func handleJsonArgs(args []string, attributes map[string]bool) []string {
|
2014-08-30 07:34:09 -04:00
|
|
|
if len(args) == 0 {
|
|
|
|
return []string{}
|
|
|
|
}
|
|
|
|
|
2014-08-13 06:07:41 -04:00
|
|
|
if attributes != nil && attributes["json"] {
|
|
|
|
return args
|
|
|
|
}
|
|
|
|
|
|
|
|
// literal string command, not an exec array
|
2014-08-30 07:34:09 -04:00
|
|
|
return []string{strings.Join(args, " ")}
|
2014-08-13 06:07:41 -04:00
|
|
|
}
|