dotfiles

My personal dotfiles

commit c3d9470e4daf30be63d5d4d43d81653b6ab995a1
parent f10b129acb6eee053651f7a5c0d4b37423e9427b
Author: Pablo Emilio Escobar Gaviria <pablo-escobar@riseup.net>
Date:   Fri, 29 Jan 2021 11:29:40 -0300

Made it so that the commit message on config --update is customizable

Diffstat:
M.config/fish/functions/config.fish | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/.config/fish/functions/config.fish b/.config/fish/functions/config.fish
@@ -1,15 +1,22 @@
 function config
+  # Calls git in the appropriate repository
   function _call_git
     git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" $argv
   end
 
-  argparse u/update a-add=+ r-rm=+ l/list -- $argv
+  argparse u/update= a-add=+ r-rm=+ l/list g-log -- $argv
 
+  # List the dotfiles specified in configurations list
   if test -n "$_flag_list"
     string replace --all "$HOME" '~' (cat ~/.local/share/configs.list)
     return
   end
 
+  if test -n "$_flag_log"
+    _call_git log
+    return
+  end
+
   # Add files to the list of dotfiles
   for item in $_flag_add
     echo "Adding '$item' to the list of dotfiles"
@@ -34,7 +41,10 @@ function config
       | xargs git --git-dir="$HOME/Documents/dotfiles" --work-tree="$HOME" add
 
     # Commit the changes
-    and _call_git commit -m "Updated the dotfiles"
+    and _call_git commit -m "$_flag_update"
+
+    # Return if there's an error
+    or return $status
 
     # Push the changes to all remotes
     for remote in (_call_git remote -v | awk '{ print $1 }' | uniq)