feat(*): support perComandTimeout & variables in options

Signed-off-by: storyicon <yuanchao@bilibili.com>
This commit is contained in:
storyicon 2021-08-28 14:36:47 +08:00
parent 7b2c0762d4
commit 15047711a9
No known key found for this signature in database
GPG key ID: 245915D985F966CF
15 changed files with 302 additions and 122 deletions

View file

@ -18,6 +18,7 @@ import (
"net/url"
"path"
"path/filepath"
"strings"
"golang.org/x/mod/module"
@ -31,6 +32,9 @@ func PathForInclude(storageDir string) string {
// PathForProtoc is used to get the local binary location where the specified version protoc should be stored
func PathForProtoc(storageDir string, version string) string {
if strings.HasPrefix(version, "v") {
version = strings.TrimPrefix(version, "v")
}
return filepath.Join(storageDir, "protoc", version, util.GetBinaryFileName("protoc"))
}
@ -72,6 +76,7 @@ func PathForPluginDir(storageDir string, path string, version string) (string, e
}
// PathForPlugin is used to get the binary path of plugin
// Path: e.g "google.golang.org/protobuf/cmd/protoc-gen-go"
func PathForPlugin(storageDir string, path string, version string) (string, error) {
name := GetGoPkgExecName(path)
dir, err := PathForPluginDir(storageDir, path, version)