Fix libexecdir/statedir being empty by default

Issue was caused by move to config.Map for global values, config.Map
sets to these values to empty strings by default.
This commit is contained in:
fox.cpp 2019-05-06 02:21:24 +03:00
parent bc98fbe98f
commit 2b67435dbf
No known key found for this signature in database
GPG key ID: E76D97CCEDE90B6C

View file

@ -19,7 +19,7 @@ func StateDirectory(globals map[string]interface{}) string {
return dir
}
if val, ok := globals["statedir"]; ok {
if val, ok := globals["statedir"]; ok && val.(string) != "" {
return val.(string)
}
@ -31,7 +31,7 @@ func LibexecDirectory(globals map[string]interface{}) string {
return dir
}
if val, ok := globals["libexecdir"]; ok {
if val, ok := globals["libexecdir"]; ok && val.(string) != "" {
return val.(string)
}