metaplugin generator progres

This commit is contained in:
idk
2022-03-27 00:18:08 -04:00
parent 840dd7f93c
commit b6b31e8ae2
3 changed files with 136 additions and 5 deletions

View File

@ -2,13 +2,14 @@ package shellservice
import "strings"
var OSES = []string{"mac", "linux", "windows"}
var ARCHES = []string{"386", "amd64", "arm", "arm64"}
func Replace(r string) string {
oses := []string{"mac", "linux", "windows"}
for _, os := range oses {
for _, os := range OSES {
r = strings.Replace(r, os, "$OS", -1)
}
arches := []string{"386", "amd64", "arm", "arm64"}
for _, arch := range arches {
for _, arch := range ARCHES {
r = strings.Replace(r, arch, "$ARCH", -1)
}
return r