Skip to content

Commit afb724f

Browse files
committed
Fix build-path parameter parsing regression
The flags package always set the string flags default to the empty string. We should test for that and not nil.
1 parent 038a06f commit afb724f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: main.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ func main() {
300300
}
301301

302302
// FLAG_BUILD_PATH
303-
buildPathUnquoted, err := gohasissues.Unquote(*buildPathFlag)
304-
if err != nil {
305-
printCompleteError(err)
306-
}
307-
buildPath := paths.New(buildPathUnquoted)
308-
if buildPath != nil {
309-
// TODO: mmmmhhh... this one looks like a bug, why check existence?
303+
if *buildPathFlag != "" {
304+
buildPathUnquoted, err := gohasissues.Unquote(*buildPathFlag)
305+
if err != nil {
306+
printCompleteError(err)
307+
}
308+
buildPath := paths.New(buildPathUnquoted)
309+
310310
if _, err := buildPath.Stat(); err != nil {
311311
fmt.Fprintln(os.Stderr, err)
312312
os.Exit(1)
@@ -384,6 +384,7 @@ func main() {
384384
ctx.SetLogger(i18n.HumanLogger{})
385385
}
386386

387+
var err error
387388
if *dumpPrefsFlag {
388389
err = builder.RunParseHardwareAndDumpBuildProperties(ctx)
389390
} else if *preprocessFlag || *codeCompleteAtFlag != "" {

0 commit comments

Comments
 (0)