dotfiles

My personal dotfiles

commit 3831a66ac3c4fde6df42e2cd5b03b5460e6ed5e6
parent e6b2a4d18276036c1a40ec8a6a3fd1b54599645a
Author: Pablo Emilio Escobar Gaviria <pablo-escobar@riseup.net>
Date:   Fri, 29 Jan 2021 11:21:55 -0300

Updated the dotfiles

Diffstat:
M.config/fish/functions/config.fish | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/.config/fish/functions/config.fish b/.config/fish/functions/config.fish
@@ -1,4 +1,8 @@
 function config
+  function _call_git
+    git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" $argv
+  end
+
   argparse u/update a-add=+ r-rm=+ l/list -- $argv
 
   if test -n "$_flag_list"
@@ -30,12 +34,15 @@ function config
       | xargs git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" add
 
     # Commit the changes
-    and git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" commit \
+    and _call_git commit \
       -m "Updated the dotfiles"
 
-    # Push the changes
-    and git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" push gitlab master
-    and git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" push origin master
+    # Push the changes to all remotes
+    set remotes (_call_git remove -v | awk '{ print $1 }' | uniq)
+
+    for remote in $remotes
+      _call_git push "$remote" master
+    end
   end
 end