Skip to content

Commit d71682b

Browse files
authored
Merge pull request #11 from DeNA/planfile-abs
Use planfile path as absolute path
2 parents 587c6ee + 9b7492f commit d71682b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cmd/core/cli/cmds/devfarm/runall/options.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"errors"
55
"github.com/dena/devfarm/cmd/core/cli"
66
"github.com/dena/devfarm/cmd/core/cli/planfile"
7+
"os"
8+
"path/filepath"
79
)
810

911
type planFilePath string
@@ -49,6 +51,14 @@ func validatePlanFiles(unsafePlanFiles []string) (planFilePath, error) {
4951
return "", errors.New("too many plan files")
5052
}
5153

52-
plan := planFilePath(unsafePlanFiles[0])
53-
return plan, nil
54+
unsafePlanFilePathAbs, err := filepath.Abs(unsafePlanFiles[0])
55+
if err != nil {
56+
return "", err
57+
}
58+
59+
if _, err = os.Stat(unsafePlanFilePathAbs); err != nil {
60+
return "", err
61+
}
62+
63+
return planFilePath(unsafePlanFilePathAbs), nil
5464
}

0 commit comments

Comments
 (0)