Skip to content

Commit

Permalink
feat(update): update
Browse files Browse the repository at this point in the history
update

Signed-off-by: ysicing <i@ysicing.me>
  • Loading branch information
ysicing committed Nov 17, 2021
1 parent 662a08c commit 695a8eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ergo CHANGELOG

- v2.6.7
- 优化`ext sync`
- 多处优化

- v2.6.6
- 优化`ext sync`, 镜像同步后端服务API调整
Expand Down
6 changes: 3 additions & 3 deletions pkg/ergo/service/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func (o *Option) downfile(dfile string) (*Service, error) {

// 下载
// o.Log.StartWait(fmt.Sprintf("下载服务脚本: %v", pn.URL))
o.Log.Debugf("下载脚本: %v", pn.URL)
_, err = downloader.Download(pn.URL, dfile)
o.Log.Debugf("下载脚本: %v", pn.GetURL())
_, err = downloader.Download(pn.GetURL(), dfile)
// o.Log.StopWait()
if err != nil {
o.Log.Errorf("下载服务脚本失败: %v", err)
Expand Down Expand Up @@ -76,7 +76,7 @@ func (o *Option) Install() error {
} else {
defer os.Remove(dfile)
if err := ssh.RunCmd("/bin/bash", dfile); err != nil {
o.Log.Errorf("%v 启动失败: %v", pn.Name, err)
o.Log.Errorf("%v 执行失败: %v", pn.Name, err)
return err
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/ergo/service/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (o *Option) Show() {
// res = append(res, pf.Plugins...)
for _, r := range pf.Services {
r.Repo = *i
r.Release = pf.Release
res = append(res, r)
}
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/ergo/service/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

type SFile struct {
Version string `yaml:"version" json:"version"`
Release string `yaml:"release,omitempty" json:"release,omitempty"`
Services []*Service `yaml:"services" json:"services"`
}

Expand All @@ -28,13 +29,17 @@ type Service struct {
Desc string `yaml:"desc" json:"desc"`
Type string `yaml:"type" json:"type"`
URL string `yaml:"url" json:"url"`
Release string `yaml:"release,omitempty" json:"release,omitempty"`
}

func (s Service) GetURL() string {
localurl := s.URL
if strings.Contains(localurl, "github") && environ.GetEnv("NO_MIRROR") == "" {
localurl = fmt.Sprintf("%v/%v", common.PluginGithubJiasu, localurl)
}
if s.Release != "" {
return strings.ReplaceAll(localurl, "master", s.Release)
}
return localurl
}

Expand Down

0 comments on commit 695a8eb

Please sign in to comment.