Skip to content

Commit 310ae5d

Browse files
committed
internal/../project_util.go: Fail on all errors
While checking for project root we want to fail on any error we encounter.
1 parent ddcad98 commit 310ae5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/util/projutil/project_util.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ func MustInProjectRoot() {
4949
// if the current directory has the "./build/dockerfile" file, then it is safe to say
5050
// we are at the project root.
5151
_, err := os.Stat(buildDockerfile)
52-
if err != nil && os.IsNotExist(err) {
53-
log.Fatalf("must run command in project root dir: project structure requires ./build/Dockerfile: (%v)", err)
52+
if err != nil {
53+
if os.IsNotExist(err) {
54+
log.Fatal("must run command in project root dir: project structure requires ./build/Dockerfile")
55+
}
56+
log.Fatalf("error: (%v) while checking if current directory is the project root", err)
5457
}
5558
}
5659

0 commit comments

Comments
 (0)