summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/allupdate64
-rwxr-xr-x.local/bin/gitrect-fix4
2 files changed, 28 insertions, 40 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
diff --git a/.local/bin/gitrect-fix b/.local/bin/gitrect-fix
index 5adfbee..8bc4490 100755
--- a/.local/bin/gitrect-fix
+++ b/.local/bin/gitrect-fix
@@ -114,8 +114,8 @@ while read -r line; do
done <$DEFAULT_STATE
# Update all remotes if we have the fetchgit command
-if [$(command -v fetchgit)]; then
- if [$(command -v fd) ]; then
+if [ $(command -v fetchgit) ]; then
+ if [ $(command -v fd) ]; then
fd -H -t d -E mod -E vendor "\.git$" $WORKDIR -x fetchgit
else
find $WORKDIR -name ".git" -exec fetchgit {} \;