1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-02-16 16:11:37 +08:00
parent d62af7bc90
commit d1c31ad7a7

View File

@ -109,11 +109,15 @@ func _repos_open(m *ice.Message, p string) *git.Repository {
return mdb.HashSelectTarget(m, p, nil).(*git.Repository) return mdb.HashSelectTarget(m, p, nil).(*git.Repository)
} }
func _repos_each(m *ice.Message, title string, cb func(*git.Repository, ice.Maps) error) { func _repos_each(m *ice.Message, title string, cb func(*git.Repository, ice.Maps) error) {
web.GoToastTable(m.Cmd(""), REPOS, func(value ice.Maps) { web.GoToast(m, func(toast func(string, int, int)) []string {
m.Cmd("").Table(func(value ice.Maps, index, total int) {
toast(value[REPOS], index, total)
if err := cb(_repos_open(m, value[REPOS]), value); err != nil && err != git.NoErrAlreadyUpToDate { if err := cb(_repos_open(m, value[REPOS]), value); err != nil && err != git.NoErrAlreadyUpToDate {
web.ToastFailure(m, value[REPOS], err.Error()) web.ToastFailure(m, value[REPOS], err.Error())
} }
}) })
return nil
})
} }
func _repos_each_origin(m *ice.Message, title string, cb func(*git.Repository, string, *http.BasicAuth, ice.Maps) error) { func _repos_each_origin(m *ice.Message, title string, cb func(*git.Repository, string, *http.BasicAuth, ice.Maps) error) {
m.Option("repos.auth", _repos_credentials(m)) m.Option("repos.auth", _repos_credentials(m))