Improved Windows support
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/compiler"
|
||||
"git.akyoto.dev/cli/q/src/config"
|
||||
"git.akyoto.dev/cli/q/src/scanner"
|
||||
)
|
||||
|
||||
@ -31,10 +32,16 @@ func (build *Build) Executable() string {
|
||||
path, _ := filepath.Abs(build.Files[0])
|
||||
|
||||
if strings.HasSuffix(path, ".q") {
|
||||
return fromFileName(path)
|
||||
path = fromFileName(path)
|
||||
} else {
|
||||
return fromDirectoryName(path)
|
||||
path = fromDirectoryName(path)
|
||||
}
|
||||
|
||||
if config.TargetOS == "windows" {
|
||||
path += ".exe"
|
||||
}
|
||||
|
||||
return path
|
||||
}
|
||||
|
||||
// fromDirectoryName returns the executable path based on the directory name.
|
||||
|
Reference in New Issue
Block a user