Skip to content

Commit

Permalink
fix: 2024-06-11 15:35:02
Browse files Browse the repository at this point in the history
  • Loading branch information
kooksee committed Jun 11, 2024
1 parent 35b4b98 commit 5208e88
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 9 additions & 0 deletions cmd/protobuild/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ func Main() *cli.App {
continue
}

if pathutil.IsNotExist(url) && dep.Optional != nil && *dep.Optional {
continue
}

v := strutil.FirstFnNotEmpty(func() string {
return versions[url]
}, func() string {
Expand Down Expand Up @@ -421,6 +425,11 @@ func Main() *cli.App {
fmt.Println(url)

url = assert.Must1(filepath.Abs(url))

if pathutil.IsNotExist(url) && dep.Optional != nil && *dep.Optional {
continue
}

newUrl := filepath.Join(cfg.Vendor, dep.Name)
assert.Must(filepath.Walk(url, func(path string, info fs.FileInfo, err error) (gErr error) {
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions cmd/protobuild/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ type plugin struct {
}

type depend struct {
Name string `yaml:"name,omitempty"`
Url string `yaml:"url,omitempty"`
Path string `yaml:"path,omitempty"`
Version *string `yaml:"version,omitempty"`
Name string `yaml:"name,omitempty"`
Url string `yaml:"url,omitempty"`
Path string `yaml:"path,omitempty"`
Version *string `yaml:"version,omitempty"`
Optional *bool `yaml:"optional,omitempty"`
}
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/pubgo/funk/assert"
)

var Version = "v0.0.1-dev"
var Version = "v0.0.20"

func init() {
if Version == "" {
Expand Down

0 comments on commit 5208e88

Please sign in to comment.