forked from ALHP/ALHP.GO
quote env if it contains whitespace
This commit is contained in:
4
utils.go
4
utils.go
@@ -503,6 +503,10 @@ func parseFlagSection(section any, makepkgConf, march string) (string, error) {
|
||||
if len(orgMatch) == 0 {
|
||||
// no match found, assume env var and append it
|
||||
log.Debugf("no match found for %s:%v, appending", subSec, subMap)
|
||||
if strings.Contains(subMap.(string), " ") {
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%q", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
|
||||
continue
|
||||
}
|
||||
makepkgConf += fmt.Sprintf("\nexport %s=%s", strings.ToUpper(subSec.(string)), replaceStringsFromMap(subMap.(string), replaceMap))
|
||||
continue
|
||||
}
|
||||
|
Reference in New Issue
Block a user