include os and arch in

This commit is contained in:
eyedeekay
2024-09-20 20:34:29 -04:00
parent b963c19eb6
commit b9964412d4
2 changed files with 19 additions and 14 deletions

View File

@ -237,14 +237,8 @@ func Copy(src, dst string) error {
}
func clientFile() string {
goos := os.Getenv("GOOS")
goarch := os.Getenv("GOARCH")
r := "client"
if goos != "" {
r += "-" + goos
}
if goarch != "" {
r += "-" + goarch
}
r += operatingSystem()
r += architecture()
return r + ".yaml"
}

View File

@ -319,15 +319,26 @@ func (pc *PluginConfig) Save() {
ioutil.WriteFile(pluginFile(), bytes, 0644)
}
func pluginFile() string {
goos := os.Getenv("GOOS")
func architecture() string {
goarch := os.Getenv("GOARCH")
r := "plugin"
if goos != "" {
r += "-" + goos
}
r := ""
if goarch != "" {
r += "-" + goarch
}
return r
}
func operatingSystem() string {
goos := os.Getenv("GOOS")
r := ""
if goos != "" {
r += "-" + goos
}
return r
}
func pluginFile() string {
r := "plugin"
r += operatingSystem()
r += architecture()
return r + ".yaml"
}