summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-08-15 13:36:59 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-08-15 13:36:59 +0200
commitcf02ebd79108335a1d2db756e107291f2e9bbe42 (patch)
tree821774f461bd2e1553c2da533c7f7fbc0cc15e03
parentb3a25c858a5cf55c954e9d78acd75a135992778d (diff)
checkpoint
-rwxr-xr-xbin/common/gt33
-rw-r--r--config/essentials/shell/aliases.sh1
-rw-r--r--config/home/.zshenv4
3 files changed, 22 insertions, 16 deletions
diff --git a/bin/common/gt b/bin/common/gt
index 8890ebb..c054bfa 100755
--- a/bin/common/gt
+++ b/bin/common/gt
@@ -29,6 +29,8 @@ usage: gt [OPTION]
EOF
}
+list_repos() { cut -f 1 -d ' ' "$repos"; }
+
# fetch repository prettily, outputs nothing if failed
fetch() {
# fetch with one-line printing of progress
@@ -66,31 +68,34 @@ while getopts ":a:c:f:lsheu" opt; do
printf >&2 'added.\n'
;;
c)
- cut -f 1 -d ' ' "$repos" |
+ list_repos |
if [ "$parallel" ]; then
parallel gt-cmd "{}" "$OPTARG"
else
xargs -I{} gt-cmd "{}" "$OPTARG"
fi
;;
- s) cut -f 1 -d ' ' "$repos" | xargs -I{} gt-st {} ;;
- l) cut -f 1 -d ' ' "$repos" ;;
+ s) list_repos | xargs -I{} gt-st {} ;;
+ l) list_repos ;;
e) $EDITOR "$repos" ;;
f) repos="$OPTARG" ;;
u)
+ >&2 printf 'pull.\n'
if [ "$parallel" ]; then
- parallel --colsep ' ' gt-sync {1} {2} <"$repos"
+ list_repos | parallel gt-cmd {} pull
+ >&2 printf 'push.\n'
+ list_repos |
+ xargs -I{} gt-st {} |
+ awk -F: '/↑/ {print $1}' |
+ parallel gt-cmd {} push
else
- IFS=' '
- while read -r repo remote_url; do
- gt-sync "$repo" "$remote_url"
- done <"$repos"
- fi | awk -F ':' '/x$/ {print $1}' | sed "s@~@$HOME@" |
- if [ "$parallel" ]; then
- parallel gt-cmd {} pull
- else
- xargs -I{} gt-cmd {} pull
- fi
+ list_repos | xargs -I{} gt-cmd {} pull
+ >&2 printf 'push.\n'
+ list_repos |
+ xargs -I{} gt-st {} |
+ awk -F: '/↑/ {print $1}' |
+ xargs -I{} gt-cmd {} push
+ fi
;;
h) help ;;
:)
diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh
index bb2d6a9..03a116b 100644
--- a/config/essentials/shell/aliases.sh
+++ b/config/essentials/shell/aliases.sh
@@ -275,6 +275,7 @@ alias cdib='cd ~/src/installdrier/deb'
alias czo='cd ~/zot/'
alias cdpw='cd ${PASSWORD_STORE_DIR:-~/.password-store}'
alias cdng='cd /etc/nginx'
+alias cdnv='cd ~/.config/nvim'
alias cdrs='cd /srv/'
alias cdv='cd ~/vids'
alias god='cd "$(find . -mindepth 1 -maxdepth 1 -type d | fzf)"'
diff --git a/config/home/.zshenv b/config/home/.zshenv
index 34a7c2f..189d10b 100644
--- a/config/home/.zshenv
+++ b/config/home/.zshenv
@@ -1,6 +1,6 @@
#!/bin/zsh
-export EDITOR="vis"
-export VISUAL="vis"
+export EDITOR="nvim"
+export VISUAL="nvim"
export BROWSER="osurf"
export VIEWER="zathura"