Skip to content

Commit dcef9a0

Browse files
committed
update gob subcommands
1 parent 64c7318 commit dcef9a0

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

ops.d/lazy/gob-lazy.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ gob_lazy() {
5858
Usage: $0 $self <sub-command> [...]
5959
6060
Sub-commands:
61-
create-git-remotes <repo-name> cmdr-series: frama, codeberg, github
62-
push-all cmdr-series: push all for current repo
63-
push-all-modules cmdr-series: push all for all repos
61+
create-git-remotes <repo-name> [group-name] cmdr-series: frama, codeberg, github
62+
push-all cmdr-series: push all for current repo
63+
push-all-modules cmdr-series: push all for all repos
6464
6565
Examples:
66-
$ gob cmdr push-all # push all for all repos (cmdr-series.v2)
66+
$ gob cmdr push-all
67+
push all for all repos (cmdr-series.v2)
68+
$ gob cmdr create-git-remotes mere1x merelab
69+
create remotes to merelab/mere1x, for github, codeberg, and frama
6770
EOF
6871
}
6972
gob_cmdr_size() {
@@ -74,10 +77,14 @@ gob_lazy() {
7477
gob_cmdr_create_git_remotes() { cmdr_create_git_remotes "$@"; }
7578
cmdr_create_git_remotes() {
7679
local key repo="${1:-gsvc}" && (($#)) && shift
77-
for key in 'github github.com hedzr' 'frama framagit.org cmdr-series' 'codeberg codeberg.org cmdr-series'; do
80+
local group="${1:-cmdr-series}" && (($#)) && shift
81+
local ghg="$group" && [ "$group" = 'cmdr-series' ] && ghg=hedzr || :
82+
local ghgroup="${1:-$ghg}" && (($#)) && shift || :
83+
for key in "github github.com ${ghgroup}" "frama framagit.org ${group}" "codeberg codeberg.org ${group}"; do
7884
eval "rr=($key)"
7985
tip "setting up remote repo / ${rr[1]} / ${rr[2]}"
80-
git remote add "${rr[1]}" "git@${rr[2]}:${rr[3]}/$repo.git"
86+
git remote add "${rr[1]}" "git@${rr[2]}:${rr[3]}/$repo.git" ||
87+
git remote set-url "${rr[1]}" "git@${rr[2]}:${rr[3]}/$repo.git"
8188
done
8289
echo
8390
git remote -v
@@ -103,7 +110,8 @@ gob_lazy() {
103110
git push $repo --all && git push $repo --tags
104111
done
105112
done
106-
for repodir in ../../cmdr.works/{cmdr-cli,cmdr-go-starter,cmdr-templates,go-template}; do
113+
cd ~work/godev/cmdr.work/cmdr-cli # ,go-template
114+
for repodir in ../../cmdr.work/{cmdr-cli,cmdr-go-starter,cmdr-templates}; do
107115
[ -d "$repodir" ] && cd "$repodir" && echo && tip "ENTERING $repodir ------------" && echo &&
108116
for repo in github frama codeberg; do
109117
tip "pushing to remote repo '$repo'..."
@@ -209,5 +217,6 @@ gob_lazy() {
209217
# go-lint=golint \
210218
# app-bundle-id=app_bundle_id
211219

220+
# set -x
212221
gob_entry "$@"
213222
}

0 commit comments

Comments
 (0)