diff options
author | xyz <gky44px1999@gmail.com> | 2021-10-23 19:51:33 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-10-23 19:51:33 -0700 |
commit | f4b83df5b3474c64f62a7a9f612abc9967ce9935 (patch) | |
tree | c550d7658ad0177c16fd962a8f2143dd5262a103 /home/xyz/.local/bin/cfg | |
parent | bb5bae6362f044860832d8cc8bad9e0bc7ce0ca7 (diff) |
refactor
Diffstat (limited to 'home/xyz/.local/bin/cfg')
-rwxr-xr-x | home/xyz/.local/bin/cfg | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/home/xyz/.local/bin/cfg b/home/xyz/.local/bin/cfg index 56ba6d71..68ace1c0 100755 --- a/home/xyz/.local/bin/cfg +++ b/home/xyz/.local/bin/cfg @@ -3,11 +3,11 @@ while getopts clsmM opt; do case $opt in c) work_tree_dir="$HOME" - cmd="git --git-dir=$HOME/.cfg$opt/ --work-tree=$HOME" - meta_file="$XDG_CONFIG_HOME/myconf/cfg${opt}_meta";; + meta_file="$XDG_CONFIG_HOME/myconf/cfg${opt}_meta" + cmd="git --git-dir=$HOME/.cfg$opt/ --work-tree=$HOME";; l|s) work_tree_dir=/ - cmd="sudo git --git-dir=/etc/.cfg$opt/ --work-tree=/" - meta_file="/etc/myconf/cfg${opt}_meta";; + meta_file="/etc/myconf/cfg${opt}_meta" + cmd="sudo git --git-dir=/etc/.cfg$opt/ --work-tree=/";; m) sudo gitmetap "$cmd" "$work_tree_dir" "$meta_file" exit;; M) sudo gitmetar "$meta_file" |