summaryrefslogtreecommitdiffstats
path: root/.local/bin/allupdate
diff options
context:
space:
mode:
authorTyler Davis <tydavis@gmail.com>2023-08-06 16:07:04 -0700
committerTyler Davis <tydavis@gmail.com>2023-08-06 16:07:04 -0700
commit432a941165bea1fe6c7b4bbdf05877321409d923 (patch)
treecc60ac718de78be18a7dd791f9d8f82e0cb9bce4 /.local/bin/allupdate
parent4975071cd648970a7a073d54cb9021f517cfa0ae (diff)
downloaddotfiles-432a941165bea1fe6c7b4bbdf05877321409d923.tar.gz
dotfiles-432a941165bea1fe6c7b4bbdf05877321409d923.zip
git: fix scripting errors
Diffstat (limited to '.local/bin/allupdate')
-rwxr-xr-x.local/bin/allupdate64
1 files changed, 26 insertions, 38 deletions
diff --git a/.local/bin/allupdate b/.local/bin/allupdate
index 422eb1f..e8da1fb 100755
--- a/.local/bin/allupdate
+++ b/.local/bin/allupdate
@@ -4,68 +4,56 @@
# Rust
if [ "$(command -v rustup)" ]; then
- rustup update;
+ rustup update
if [ "$(command -v cargo)" ]; then
- cargo --list |grep install-update &> /dev/null
+ cargo --list | grep install-update &>/dev/null
if [ $? -eq 0 ]; then
- cargo install-update -a;
+ cargo install-update -a
fi
fi
fi
-case `uname` in
+case $(uname) in
Darwin)
if [ "$(command -v gcloud)" ]; then
- gcloud components update;
+ gcloud components update
fi
- if [ -d "~/work" ]; then
- # Git config for work
- if [ "$(command -v fd)" ]; then
- fd -H -t d -E mod -E vendor '.git$' ~/.code/work -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile /Users/tydavis/.gitcookies-work;" ;
- fi
+
+ if [ "$(command -v fetchgit)" ] && [ -d ~/.code ]; then
+ # Git config for work
+ if [ "$(command -v fd)" ]; then
+ fd -H -t d -E mod -E vendor '.git$' ~/.code/work -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile /Users/tydavis/.gitcookies-work;"
+ fi
+ if [ "$(command -v gitrect-update)" ] && [ "$(command -v gitrect-fix)" ]; then gitrect-fix && gitrect-update; fi
fi
if [ "$(command -v code)" ]; then
- code --list-extensions > ~/.setup/code-extensions
+ code --list-extensions >~/.setup/code-extensions
fi
# Brew specifics, add installed formula capture later.
if [ "$(command -v brew)" ]; then
- brew upgrade -q;
+ brew upgrade -q
fi
- if [ "$(command -v gitrect)" ]; then
- gitrect -v -d ~/.code/ ;
- # Update our list of git repos
- gitrect -u -d ~/.code/ ;
- fi
- ;;
+ ;;
Linux)
# Do APK stuff manually
# Git config for work
- if [ "$(command -v fetchgit)" ]; then
- # Update all existing repos
- if [ "$(command -v fd)" ]; then
- fd -H -t d -E mod -E vendor '.git$' ~/work -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile /home/tydavis/.gitcookies-work;" ;
- fi
- if [ -d "~/.golang/go" ]; then
- cd ~/.golang/go;
- fetchgit;
- fi
- fi
- if [ "$(command -v gitrect)" ]; then
- gitrect -v;
- # Update our list of git repos
- gitrect -u;
- else
- if [ "$(command -v go)" ]; then
- go install -u github.com/tydavis/utilities/cmd/gitrect ;
- else
- echo "Go compiler not found"
+ if [ "$(command -v fetchgit)" ] && [ -d ~/.code ]; then
+ # Update all existing repos
+ if [ "$(command -v fd)" ]; then
+ fd -H -t d -E mod -E vendor '.git$' ~/.code/work -x bash -c "cd {//}; git config user.email tdavis@hpe.com; git config http.cookiefile /home/tydavis/.gitcookies-work;"
+ fi
+
+ if [ -d "~/.golang/go" ]; then
+ cd ~/.golang/go
+ fetchgit
fi
+ if [ "$(command -v gitrect-update)" ] && [ "$(command -v gitrect-fix)" ]; then gitrect-fix && gitrect-update; fi
fi
- ;;
+ ;;
esac
echo "" # Newline