Skip to content

Commit 71dd2ca

Browse files
committed
Set schemas path relative to executable
Previously, the schemas path was defined relative to the working directory, but the schemas will be stored in a path relative to the arduino-check executable.
1 parent 99f300a commit 71dd2ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: configuration/configuration.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ func TargetPath() *paths.Path {
9999

100100
// SchemasPath returns the path to the folder containing the JSON schemas.
101101
func SchemasPath() *paths.Path {
102-
workingPath, _ := os.Getwd()
103-
return paths.New(workingPath)
102+
executablePath, err := os.Executable()
103+
if err != nil {
104+
panic(err)
105+
}
106+
return paths.New(executablePath).Parent()
104107
}

0 commit comments

Comments
 (0)