Skip to content

Commit

Permalink
create dotme-apps ; google sdk for dotme-apps ; package updates (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhomer authored Jun 11, 2023
1 parent cf3b569 commit 09a1557
Show file tree
Hide file tree
Showing 15 changed files with 1,143 additions and 950 deletions.
1 change: 1 addition & 0 deletions bin/dotme
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ command_packages() {
if [[ $DRY -eq 0 ]] ; then
if is-macos ; then
dotme-brew
dotme-apps
elif is-android ; then
dotme-pkg
elif has-pacman ; then
Expand Down
39 changes: 39 additions & 0 deletions bin/dotme-apps
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Install apps
#
# Alternative approach to brew where brew is not appropriate, e.g. with cask in
# brew that requires admin password to install (and hence requires user
# interaction)
#

set -e
$(shim) && cd ${ME} && . bin/i.sh
should-run -m 7 $@ $0 || exit 0

#
# Manual gcloud install process. Prefered over brew, since we have this in brew
# brew update requires users' password. Furthermore it is not possible to pin a cask
# in brew to control the update process in brew. Requiring a password breaks
# non-interactive flow which disrupts general day-to-day processes.
#
# TODO : Consider update process of this, does gcloud itself warn us if it is
# out of date. When I run into this, I will update this process to handle
# updates.
if ! command -v gcloud 2>/dev/null ; then
log:: "gcloud is not installed"
downloaded=~/local/gcloud/google-cloud-cli*.tar.gz
echo $downloaded
mkdir -p ~/local/gcloud
if [ ! -f ${downloaded} ] ; then
log:: "Download latest tar.gz from https://cloud.google.com/sdk/docs/install-sdk to ~/local/gcloud"
log:: "... cd ~/local/gcloud ; curl -O URL"
log:: "... and then rerun this"
else
cd ~/local/gcloud
echo "Installing from "${downloaded}
tar xvf ${downloaded}
fi
fi

should-run -fu $0
3 changes: 3 additions & 0 deletions bin/dotme-fish
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ else
fish_add_path /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.10/bin
end

# Google cloud
fish_add_path ~/local/gcloud/google-cloud-sdk/bin

# Android development
fish_add_path ~/Library/Android/sdk/emulator
fish_add_path ~/Library/Android/sdk/platform-tools
Expand Down
6 changes: 3 additions & 3 deletions bin/dotme-rust
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env bash

should-run -m 7 $0 || exit 0
should-run -m 7 $@ $0 || exit 0
$(shim) && cd ${ME} && . bin/i.sh

log:: "configuring rust"

if ! command -v cargo ; then
log:: "initialising rust"
rustup-init -y
fi

rustup update
cargo install stylua

should-run -fu $0


2 changes: 1 addition & 1 deletion bin/dotme-tmux
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Install tpm - tmux plugin manager
#

should-run -m 7 $0 || exit 0
should-run -m 7 $@ $0 || exit 0

$(shim) && cd ${ME} && . bin/i.sh

Expand Down
6 changes: 5 additions & 1 deletion bin/git-synk
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function gitSynk() {
current=`pwd | sed 's|.*/||g'`
changes=$(git status --porcelain | wc -l)

if [[ "$branchName" != */* ]] ; then
if [[ "$branchName" == "main" ]] ; then
log::info "Pulling ${PWD##*/} from main, no push"
git pull
return
elif [[ "$branchName" != */* ]] ; then
if [[ $changes -gt 0 ]] ; then
if [[ "true" == `git config core.autocommit` ]] ; then
# Automatically create batch
Expand Down
5 changes: 5 additions & 0 deletions bin/should-run
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ Check if script needs to run
should-run $0 || exit
Pass all arguments on current script into should-run, for example supporting
pass through of "-f"
should-run $0 || exit
Check if script needs to run, with expiry
should-run -m 1 $0 || exit # 1 day
Expand Down
8 changes: 7 additions & 1 deletion config/brew/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ brew "bitwarden-cli"
brew "charmbracelet/tap/gum"
brew "gh"
brew "git"
brew "gitleaks"
brew "gpg"
brew "gradle"
brew "hashicorp/tap/terraform-ls"
Expand All @@ -152,7 +153,12 @@ brew "warrensbox/tap/tgswitch"
brew "watchman"

cask "db-browser-for-sqlite"
cask "google-cloud-sdk"
#
# Don't install google-cloud-sdk by brew since it asks for admin password and
# breaks non-interactive flow
#
# cask "google-cloud-sdk"
#
cask "lens"
#cask "libreoffice"
cask "visual-studio-code"
Expand Down
Loading

0 comments on commit 09a1557

Please sign in to comment.