mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Dependency updates
This commit is contained in:
24
vendor/github.com/gobuffalo/meta/app.go
generated
vendored
24
vendor/github.com/gobuffalo/meta/app.go
generated
vendored
@@ -8,13 +8,13 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/gobuffalo/envy"
|
||||
"github.com/gobuffalo/flect/name"
|
||||
"github.com/markbates/oncer"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rogpeppe/go-internal/modfile"
|
||||
)
|
||||
|
||||
// App represents meta data for a Buffalo application on disk
|
||||
@@ -48,25 +48,21 @@ func (a App) IsZero() bool {
|
||||
}
|
||||
|
||||
func resolvePackageName(name string, pwd string) string {
|
||||
result := envy.CurrentPackage()
|
||||
result, _ := envy.CurrentModule()
|
||||
|
||||
if filepath.Base(result) != name {
|
||||
result = path.Join(result, name)
|
||||
}
|
||||
if envy.Mods() {
|
||||
//Extract package from go.mod
|
||||
p := filepath.Join(pwd, "go.mod")
|
||||
if f, err := os.Open(p); err == nil {
|
||||
if s, err := ioutil.ReadAll(f); err == nil {
|
||||
re := regexp.MustCompile("module (.*)")
|
||||
res := re.FindAllStringSubmatch(string(s), 1)
|
||||
|
||||
if len(res) == 1 && len(res[0]) == 2 {
|
||||
return res[0][1]
|
||||
}
|
||||
result = filepath.Base(pwd)
|
||||
}
|
||||
moddata, err := ioutil.ReadFile(filepath.Join(pwd, name, "go.mod"))
|
||||
if err != nil {
|
||||
return result
|
||||
}
|
||||
packagePath := modfile.ModulePath(moddata)
|
||||
if packagePath == "" {
|
||||
return name
|
||||
}
|
||||
return packagePath
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user