diff --git a/android-development.sh b/android-development.sh index 048baf1..98363f2 100755 --- a/android-development.sh +++ b/android-development.sh @@ -5,21 +5,29 @@ # Exit immediately if a command exits with a non-zero status set -e -# Update the user's cached credentials, authenticating the user if necessary -sudo -v +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if ! command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Homebrew not found. Installing now..." + ${DIR}/brew.sh fi -if command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Installing Android development environment...' +if command -v "brew" > /dev/null 2>&1; then + echo "==> Installing Android development environment..." + brew cask install android-studio echo 'export PATH=$PATH:$HOME/Library/Android/sdk/platform-tools/' >> ~/.bash_profile echo 'export PATH=$PATH:$HOME/Library/Android/sdk/tools/' >> ~/.bash_profile + echo '\n' >> ~/.bash_profile + + echo 'export PATH=$PATH:$HOME/Library/Android/sdk/platform-tools/' >> ~/.zshenv + echo 'export PATH=$PATH:$HOME/Library/Android/sdk/tools/' >> ~/.zshenv + echo '\n' >> ~/.zshenv + + echo "==> Android development environment installed." else - echo '==> Homebrew not found. Aborting...' + echo "==> Homebrew not found. Aborting..." exit 1 fi diff --git a/angular.sh b/angular.sh deleted file mode 100755 index 71f0b0a..0000000 --- a/angular.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Install Angular - -# Exit immediately if a command exits with a non-zero status -set -e - -# Update the user's cached credentials, authenticating the user if necessary -sudo -v - -if ! command -v 'npm' >/dev/null 2>&1 ; then - echo '==> NPM not installed. Installing Node.js now...' - ./nodejs.sh -fi - -if command -v 'npm' >/dev/null 2>&1 ; then - echo '==> Installing Angular CLI...' - npm install -g @angular/cli -else - echo '==> NPM not installed. Aborting...' - exit 1 -fi diff --git a/bootstrap.sh b/bootstrap.sh index 04e0122..eee613a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,48 +8,31 @@ set -e # Update the user's cached credentials, authenticating the user if necessary sudo -v -echo '==> Install macOS updates? (Y/n)' -read USER_PROMPT -if [ "$USER_PROMPT" == 'y' ] || [ "$USER_PROMPT" == '' ]; then - echo "==> Updating macOS..." - softwareupdate -l - softwareupdate -i -a -else - echo '==> Skipping macOS updates' -fi +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -echo '==> Install macOS tweaks? (Y/n)' +echo "==> Install macOS tweaks? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" == 'y' ] || [ "$USER_PROMPT" == '' ]; then - echo '==> Installing macOS tweaks...' - - # Enable dark theme - defaults write NSGlobalDomain AppleInterfaceStyle Dark - - # Always show scrollbars - defaults write NSGlobalDomain AppleShowScrollBars -string "Always" - - # Disable natural scrolling - defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false - - # Automatically hide and show the Dock - defaults write com.apple.dock autohide -bool true +if [[ "$USER_PROMPT" == 'y' ]] || [[ "$USER_PROMPT" == '' ]]; then + ${DIR}/macos-tweaks.sh else - echo '==> Skipping macOS tweaks' + echo "==> Skip installing macOS tweaks." fi -echo '==> Install user applications? (Y/n)' +echo "==> Install user applications? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" == 'y' ] || [ "$USER_PROMPT" == '' ]; then - ./user-applications.sh +if [[ "$USER_PROMPT" == 'y' ]] || [[ "$USER_PROMPT" == '' ]]; then + ${DIR}/gui-applications.sh else - echo '==> Skipping user applications' + echo "==> Skip installing user applications." fi -echo '==> Install development utilities? (Y/n)' +echo "==> Install development utilities? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" == 'y' ] || [ "$USER_PROMPT" == '' ]; then - ./development-utils.sh +if [[ "$USER_PROMPT" == 'y' ]] || [[ "$USER_PROMPT" == '' ]]; then + ${DIR}/development-utils.sh else - echo '==> Skipping development utilities' + echo "==> Skip installing development utilities." fi + +echo "==> Bootstrap complete." diff --git a/brew.sh b/brew.sh index 8a0a428..5539df4 100755 --- a/brew.sh +++ b/brew.sh @@ -5,8 +5,6 @@ # Exit immediately if a command exits with a non-zero status set -e -# Update the user's cached credentials, authenticating the user if necessary -sudo -v - -echo '==> Installing Homebrew...' -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +echo "==> Installing Homebrew..." +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" +echo "==> Homebrew installed." diff --git a/development-utils.sh b/development-utils.sh index 6c8cccc..335476d 100755 --- a/development-utils.sh +++ b/development-utils.sh @@ -8,108 +8,82 @@ set -e # Update the user's cached credentials, authenticating the user if necessary sudo -v -if ! command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Install Homebrew? (Y/n)' - read USER_PROMPT - if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./brew.sh - else - echo '==> Skipping Homebrew' - fi -fi - -echo '==> Tap Homebrew Caskroom? (Y/n)' -read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - echo '==> Tapping Homebrew Caskroom...' - - brew tap caskroom/cask - brew tap caskroom/versions -else - echo '==> Skipping Homebrew Cask' -fi - -echo '==> Install updated GNU utilities? (Y/n)' -read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./gnu-utils.sh -else - echo '==> Skipping updated GNU utilities' -fi +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -echo '==> Install development applications? (Y/n)' +echo "==> Install Xcode command line tools? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - echo '==> Installing development applications...' - brew install git - brew cask install docker gitkraken intellij-idea iterm2 postman visual-studio-code +if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + echo "==> Installing Xcode command line tools..." + xcode-select --install + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + echo "==> Xcode command line tools installed." else - echo '==> Skipping development applications' + echo "==> Skip installing Xcode command line tools." fi -echo '==> Install Node.js? (Y/n)' +echo "==> Install CocoaPods? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./nodejs.sh +if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + echo "==> Installing CocoaPods..." + sudo gem install cocoapods + echo "==> CocoaPods installed." else - echo '==> Skipping Node.js' + echo "==> Skip installing CocoaPods." fi -echo '==> Install Ionic? (Y/n)' -read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./ionic.sh - - echo '==> Clone Ionic projects? (Y/n)' +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Install Homebrew? (Y/n)" read USER_PROMPT - if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./ionic-projects.sh + if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + ${DIR}/brew.sh else - echo '==> Skipping Ionic projects' + echo "==> Skip installing Homebrew." fi -else - echo '==> Skipping Ionic' fi -echo '==> Install Angular? (Y/n)' +echo "==> Install updated GNU utilities? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./angular.sh - - # echo '==> Clone Angular projects? (Y/n)' - # read USER_PROMPT - # if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - # ./angular-projects.sh - # else - # echo '==> Skipping Angular projects' - # fi +if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + ${DIR}/gnu-utils.sh else - echo '==> Skipping Angular' + echo "==> Skip installing updated GNU utilities." fi -echo '==> Install Java 8? (Y/n)' +echo "==> Install development applications? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = 'yes' ] || [ "$USER_PROMPT" = '' ]; then - if ! command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh - fi +if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + echo "==> Installing development applications..." + brew install git - if command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Installing Java 8...' - brew cask install java8 + brew cask install \ + docker \ + gitkraken \ + hyper \ + intellij-idea \ + iterm2 \ + postman \ + visual-studio-code +else + echo "==> Skip installing development applications." +fi + +if ! command -v "node" > /dev/null 2>&1; then + echo "==> Install Node.js? (Y/n)" + read USER_PROMPT + if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + ${DIR}/nodejs.sh else - echo '==> Homebrew not found. Aborting...' - exit 1 + echo "==> Skip installing Node.js." fi -else - echo '==> Skipping Java 8' fi -echo '==> Install Android development environment? (Y/n)' +echo "==> Install Android development environment? (Y/n)" read USER_PROMPT -if [ "$USER_PROMPT" = 'y' ] || [ "$USER_PROMPT" = '' ]; then - ./android-development.sh +if [[ "$USER_PROMPT" = 'y' ]] || [[ "$USER_PROMPT" = '' ]]; then + ${DIR}/android-development.sh else - echo '==> Skipping Android development environment' + echo "==> Skip installing Android development environment." fi + +echo "==> Development utilities installed." diff --git a/fts/bootstrap.sh b/fts/bootstrap.sh deleted file mode 100755 index 0bc960f..0000000 --- a/fts/bootstrap.sh +++ /dev/null @@ -1,30 +0,0 @@ -# Install FTS Packages - -echo '==> Install TunnelBlick VPN client? (Y/n)' -read INSTALL_MACOS_UPDATES -if [ "$INSTALL_MACOS_UPDATES" = 'y' ] || [ "$INSTALL_MACOS_UPDATES" = 'yes' ] || [ "$INSTALL_MACOS_UPDATES" = '' ]; then - brew cask install tunnelblick -else - echo '==> Skipping TunnelBlick' -fi - -echo '==> Did you set up your SSH key yet? (Y/n)' -read SSH_KEY -if [ "$SSH_KEY" = 'y' ] || [ "$SSH_KEY" = 'yes' ] || [ "$SSH_KEY" = '' ]; then - echo '==> Clone FTS source code? (Y/n)' - read FTS_SOURCE - if [ "$FTS_SOURCE" = 'y' ] || [ "$FTS_SOURCE" = 'yes' ] || [ "$FTS_SOURCE" = '' ]; then - mkdir -p ~/code/fts - cd ~/code/fts - git clone git@github.com:sporting-innovations/fan360Core.git - git clone git@github.com:sporting-innovations/global-ref-data.git - git clone git@github.com:sporting-innovations/fan360-dimension.git - git clone git@github.com:sporting-innovations/si-dimension.git - git clone git@github.com:sporting-innovations/fan-classification.git - git clone git@github.com:sporting-innovations/fan360-communications.git - git clone git@github.com:sporting-innovations/fan360-triggers.git - else - echo '==> Skipping FTS source code' - fi - -fi diff --git a/fts/dimension.sh b/fts/dimension.sh deleted file mode 100755 index 83cb08e..0000000 --- a/fts/dimension.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -echo '==> Checking if Homebrew is installed...' -which -s brew -if [[ $? != 0 ]] ; then - # Install Homebrew - echo '==> Homebrew not found, install Homebrew? (Y/n)' - read INSTALL_HOMEBREW - if [ "$INSTALL_HOMEBREW" = 'y' ] || [ "$INSTALL_HOMEBREW" = 'yes' ] || [ "$INSTALL_HOMEBREW" = '' ]; then - # Install Homebrew - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - else - echo '==> Skipping Homebrew' - fi -else - echo '==> Homebrew found, updating packages' - brew update -fi - -echo '==> Installing required Homebrew packages' -brew install maven nvm tomcat - -echo '==> Installing Node.js...' -nvm install --lts=Boron - -echo '==> Installing required NPM packages...' -npm install -g bower gulp nodemon - -mkdir -p ~/code/fts -cd ~/code/fts - -git clone git@github.com:sporting-innovations/fan360-dimension.git -git clone git@github.com:sporting-innovations/si-dimension.git diff --git a/gnu-utils.sh b/gnu-utils.sh index eaa3fda..c9797d5 100755 --- a/gnu-utils.sh +++ b/gnu-utils.sh @@ -8,22 +8,27 @@ set -e # Update the user's cached credentials, authenticating the user if necessary sudo -v -if ! command -v brew >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Homebrew not found. Installing now..." + ${DIR}/brew.sh fi -if command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Installing updated GNU utilities...' +if command -v "brew" > /dev/null 2>&1; then + echo "==> Installing updated GNU utilities..." # Install current version of bash brew install bash # Install GNU versions of command line utils - brew install grep --with-default-names - brew install gnu-sed --with-default-names + brew install grep + brew install gnu-sed brew install moreutils + + echo "==> Updated GNU utilities installed." else - echo '==> Homebrew not found. Aborting...' + echo "==> Homebrew not found. Aborting..." exit 1 fi diff --git a/gui-applications.sh b/gui-applications.sh new file mode 100755 index 0000000..da2df7a --- /dev/null +++ b/gui-applications.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# User Applications + +# Exit immediately if a command exits with a non-zero status +set -e + +# Update the user's cached credentials, authenticating the user if necessary +sudo -v + +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Homebrew not found. Installing now..." + ${DIR}/brew.sh +fi + +if command -v "brew" > /dev/null 2>&1; then + echo "==> Installing user applications..." + + brew cask install \ + alfred \ + android-file-transfer \ + firefox \ + hyper \ + keka \ + plex-media-server \ + pocket-casts \ + slack \ + spotify \ + telegram-desktop \ + transmission \ + vlc \ + + echo "==> User applications installed." +else + echo "==> Homebrew not found. Aborting..." + exit 1 +fi diff --git a/ionic-projects.sh b/ionic-projects.sh deleted file mode 100755 index 2066089..0000000 --- a/ionic-projects.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -# Clone Ionic Projects - -# Exit immediately if a command exits with a non-zero status -set -e - -# Update the user's cached credentials, authenticating the user if necessary -sudo -v - -if ! command -v brew >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh -fi - -if command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Installing CouchDB...' - brew install couchdb - brew services start couchdb - - echo '==> Adding CORS to CouchDB...' - npm install -g add-cors-to-couchdb - add-cors-to-couchdb - - if ! command -v 'git' >/dev/null 2>&1 ; then - brew install git - fi - - if command -v 'git' >/dev/null 2>&1 ; then - # Create Source Code Directory - mkdir -p ~/code/ionic - cd ~/code/ionic - - # Clone Ionic Projects - git clone https://github.com/dshoe/taskit-ionic.git - git clone https://github.com/dshoe/CryptoProfitLog.git - git clone https://github.com/dshoe/DaysSince.git - git clone https://github.com/dshoe/WaterWatch.git - else - echo '==> Git not found. Aborting...' - exit 1 - fi -else - echo '==> Homebrew not found. Aborting...' - exit 1 -fi diff --git a/ionic.sh b/ionic.sh deleted file mode 100755 index 05578c9..0000000 --- a/ionic.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# Install Ionic - -# Exit immediately if a command exits with a non-zero status -set -e - -# Update the user's cached credentials, authenticating the user if necessary -sudo -v - -if ! command -v 'npm' >/dev/null 2>&1 ; then - echo '==> NPM not installed. Installing Node.js now...' - ./nodejs.sh -fi - -if command -v 'npm' >/dev/null 2>&1 ; then - echo '==> Installing Ionic CLI...' - npm install -g ionic cordova -else - echo '==> NPM not installed. Aborting...' - exit 1 -fi diff --git a/java8.sh b/java8.sh new file mode 100755 index 0000000..3386994 --- /dev/null +++ b/java8.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Install Java 8 + +# Exit immediately if a command exits with a non-zero status +set -e + +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Homebrew not found. Installing now..." + ${DIR}/brew.sh +fi + +if command -v "brew" > /dev/null 2>&1; then + echo "==> Tapping OpenJDK..." + brew tap homebrew/cask-versions + echo "==> OpenJDK tapped." + + echo "==> Installing OpenJDK 8..." + brew cask install adoptopenjdk8 + echo "==> OpenJDK 8 installed." +fi diff --git a/macos-tweaks.sh b/macos-tweaks.sh index d8e1604..d4bac2e 100755 --- a/macos-tweaks.sh +++ b/macos-tweaks.sh @@ -5,7 +5,7 @@ # Exit immediately if a command exits with a non-zero status set -e -echo '==> Tweaking macOS settings...' +echo "==> Tweaking macOS settings..." ############################################################################### # General # @@ -13,9 +13,36 @@ echo '==> Tweaking macOS settings...' # Always show scrollbars defaults write NSGlobalDomain AppleShowScrollBars -string "Always" +# Disable automatic capitalization as it’s annoying when typing code +defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false + +# Disable smart dashes as they’re annoying when typing code +defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false + +# Disable automatic period substitution as it’s annoying when typing code +defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false + +# Disable smart quotes as they’re annoying when typing code +defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false + # Disable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false +# Enable dark theme +# defaults write NSGlobalDomain AppleInterfaceStyle Dark + +# Enter sleep mode after 60 minutes +# sudo systemsetup -setcomputersleep 60 + +# Disable Notification Center and remove the menu bar icon +#launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null + +############################################################################### +# General # +############################################################################### +# Allow apps downloaded from "anywhere" +sudo spctl --master-disable + ############################################################################### # Input # ############################################################################### @@ -46,8 +73,8 @@ defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false # Avoid creating .DS_Store files on network or USB volumes -defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true -defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true +#defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true +#defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true ############################################################################### # Dock # @@ -55,12 +82,32 @@ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true # Automatically hide and show the Dock defaults write com.apple.dock autohide -bool true +############################################################################### +# Dock # +############################################################################### +# Show seconds in menu bar +defaults write com.apple.menuextra.clock DateFormat -string "EEE h:mm:ss a" + +############################################################################### +# Messages # +############################################################################### +# Disable automatic emoji substitution (i.e. use plain text smileys) +defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false + +# Disable smart quotes as it’s annoying for messages that contain code +defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false + +# Disable continuous spell checking +defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false + ############################################################################### # Kill affected applications # ############################################################################### for app in "Dock" \ - "Finder"; do + "Finder" \ + "Messages" \ + "SystemUIServer"; do killall "${app}" &> /dev/null done -echo '==> Done tweaking macOS settings' +echo "==> Done tweaking macOS settings" diff --git a/nodejs.sh b/nodejs.sh index e21ebb4..9c326e4 100755 --- a/nodejs.sh +++ b/nodejs.sh @@ -9,29 +9,21 @@ # Update the user's cached credentials, authenticating the user if necessary sudo -v -if ! command -v brew >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh -fi - -if command -v 'brew' >/dev/null 2>&1 ; then - # Install Node Version Manager - echo "==> Installing NVM..." - brew install nvm - - # Allow NVM without restarting - source $(brew --prefix nvm)/nvm.sh - - # Allow NVM after restarting - echo 'source $(brew --prefix nvm)/nvm.sh' >> ~/.profile - - echo "==> NVM installed." - - # Install latest Node.js with NVM - echo "==> Installing latest Node.js LTS..." - nvm install --lts - echo "==> Latest Node.js LTS installed." -else - echo '==> Homebrew not found. Aborting...' - exit 1 -fi +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +echo "==> Installing Node Version Manager..." + +# Install Node Version Manager +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash + +# Allow NVM without restarting +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + +echo "==> Node Version Manager installed." + +# Install latest Node.js with NVM +echo "==> Installing latest Node.js LTS..." +nvm install --lts +echo "==> Latest Node.js LTS installed." diff --git a/oh-my-zsh-plugins.sh b/oh-my-zsh-plugins.sh new file mode 100755 index 0000000..c0dfbed --- /dev/null +++ b/oh-my-zsh-plugins.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Configure Oh My Zsh plugins + +# Exit immediately if a command exits with a non-zero status +set -e + +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [[ ! -f "~/.zshrc" ]]; then + echo "==> Configuring Oh My Zsh plugins..." + sed -i -e 's/plugins=(git)/plugins=(git mvn nvm z)/g' ~/.zshrc + echo "==> Oh My Zsh plugins configured." +else + echo "==> .zshrc not found, Oh My Zsh possibly not installed. Aborting." + exit 1 +fi diff --git a/user-applications.sh b/user-applications.sh deleted file mode 100755 index c36ff50..0000000 --- a/user-applications.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# User Applications - -# Exit immediately if a command exits with a non-zero status -set -e - -# Update the user's cached credentials, authenticating the user if necessary -sudo -v - -if ! command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Homebrew not found. Installing now...' - ./brew.sh -fi - -if command -v 'brew' >/dev/null 2>&1 ; then - echo '==> Installing user applications...' - brew cask install android-file-transfer clover-configurator eqmac firefox google-chrome keka slack spotify telegram-desktop transmission vlc -else - echo '==> Homebrew not found. Aborting...' - exit 1 -fi diff --git a/zsh.sh b/zsh.sh new file mode 100755 index 0000000..c065dca --- /dev/null +++ b/zsh.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Install updated ZSH and Oh My Zsh + +# Exit immediately if a command exits with a non-zero status +set -e + +# Store a local variable of the scripts current directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if ! command -v "brew" > /dev/null 2>&1; then + echo "==> Homebrew not found. Installing now..." + ${DIR}/brew.sh +fi + +if command -v "brew" > /dev/null 2>&1; then + echo "==> Installing updated ZSH..." + brew install zsh zsh-completions + echo "==> Updated ZSH installed." + + echo 'export EDITOR=nano' >> ~/.zshenv + echo "\n" >> ~/.zshenv + + echo "==> Installing Oh My Zsh..." + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +fi