MCPcopy Create free account
hub / github.com/akyoto/q / Executable

Method Executable

src/config/Executable.go:9–27  ·  view source on GitHub ↗

Executable returns the path to the executable.

()

Source from the content-addressed store, hash-verified

7
8// Executable returns the path to the executable.
9func (build *Build) Executable() string {
10 path, err := filepath.Abs(build.Files[0])
11
12 if err != nil {
13 panic(err)
14 }
15
16 if strings.HasSuffix(path, ".q") {
17 path = fromFileName(path)
18 } else {
19 path = fromDirectoryName(path)
20 }
21
22 if build.OS == Windows {
23 path += ".exe"
24 }
25
26 return path
27}
28
29// fromFileName returns the executable path based on the file name.
30func fromFileName(path string) string {

Callers 5

buildFunction · 0.80
runFunction · 0.80
initFunction · 0.80
TestFieldsFunction · 0.80
RunBuildMethod · 0.80

Calls 2

fromFileNameFunction · 0.85
fromDirectoryNameFunction · 0.85

Tested by 2

TestFieldsFunction · 0.64
RunBuildMethod · 0.64