diff --git a/.travis.yml b/.travis.yml index 1c8d6cc..3a60326 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,10 @@ script: - shellcheck createDirectoriesTree.sh - shellcheck common.sh - shellcheck install.sh - - shellcheck modules/sdkman/sdkman.sh + - shellcheck modules/sdkman.sh - shellcheck modules/android.sh - shellcheck modules/gimp.sh - shellcheck modules/git.sh - - shellcheck modules/go.sh - shellcheck modules/google-drive.sh - shellcheck modules/heroku.sh - shellcheck modules/homebrew.sh @@ -22,7 +21,7 @@ script: - shellcheck modules/maven.sh - shellcheck modules/mixxx.sh - shellcheck modules/nodejs.sh - - shellcheck modules/oh-my-zsh.sh + - shellcheck modules/oh-my-zsh/oh-my-zsh.sh - shellcheck modules/ssh.sh - shellcheck modules/sublime-text.sh - shellcheck modules/tomcat.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 1159ef4..013679e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +# v2.3.0 +## Added +- Finder relaunch automatically. +- Comments in Android related env vars in .bashrc and .zshrc. +- ERROR/WARN/INFO preffix for logs. +- `DEFAULT_USER` environment variable. #74 +- GIT remote to the oh-my-zsh info. #80 + +## Changed +- Order modules by priority at `common.sh`. +- Setup Finder to show hidden files at the beginning in favor of future errors. +- Intellij IDEA and Android Studio download links changed to JetBrains toolbox. +- Minor things in README to make it clearer. +- Google Drive client for OS X now is only suggested via the official download page. +- Tomcat to v9.0.20. +- Install ZSH only when isn't already installed. +- Java installed through sdkman. +- Log files are cleaned on each run. + +## Fixed +- GIT properties now are configured ok. #66 +- Directories tree now is fully created. +- `tail` command in README as well as logs. +- Fallback when cding because currently it's not exiting right. +- Not going back to EFU's execution directory after installing Android utilities. +- Tomcat installation was breaking the script. +- `java` command execution on OS X without having it installed. +- Missing logs on summary. + +## Removed +- Deprecated links and graphics from README. +- Dex2Jar Android utility in favor of user specific needs. +- Go language in favor of user's specific needs. +- Global Gradle properties in favor of per project optimized settings. +- Duplicated logs. + # v2.2.0 ## Added - History changelog to let user view the diff. diff --git a/README.md b/README.md index 7fb834e..e9dea51 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,16 @@ EFU (Easy-Fast-Upgradable): The SH script you need to finish your Ubuntu/MacOS X [![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://nodejs.org/api/documentation.html#documentation_stability_index) [![Build Status](https://travis-ci.org/barriosnahuel/efu.svg?branch=master)](https://travis-ci.org/barriosnahuel/efu) -## Issues: [![Stories ready to be worked on](https://badge.waffle.io/barriosnahuel/efu.png?label=ready&title=Ready)](https://waffle.io/barriosnahuel/efu) [![Stories in progress](https://badge.waffle.io/barriosnahuel/efu.png?label=in progress&title=In Progress)](https://waffle.io/barriosnahuel/efu) - - ## Use it 1. Download [latest release](https://github.com/barriosnahuel/efu/releases). 2. `cd` into downloaded directory. -3. Edit `properties.sh` with your custom info. Properties are required in order tu setup GIT. +3. Edit `properties.sh` with your custom info. 4. `sh install.sh [osx | ubuntu | lubuntu]` - -On OS X, also: -5. In a new tab of your terminal: `tail –f ~/Downloads/efu.log` -6. Once finished, take a look to: `~/Downloads/summary.efu.log` +5. *\[OS X only]* In a new tab of your terminal: `tail ~/Downloads/efu.log –f` +6. *\[OS X only]* In a new tab of your terminal: `tail ~/Downloads/summary.efu.log -f` So you will have 3 tabs: -- One for the main script: `install.sh` ⇐ *You should check this tab because it will ask you for some things.* +- One for the main script you're running: `install.sh` ⇐ *You should check this tab because it will ask you for some things.* - One for `efu.log` output. ⇐ *Full script output.* - One for `summary.efu.log` output. ⇐ *Most cases this will be enough.* @@ -36,8 +31,6 @@ With a little of your interaction, EFU will: - [Pidcat](https://github.com/JakeWharton/pidcat) - Gimp - GIT - - Go language - - [Google Drive command line client](https://github.com/odeke-em/drive) - Heroku toolbelt - Maven - [Mixxx](http://www.mixxx.org/): DJ software @@ -49,6 +42,7 @@ With a little of your interaction, EFU will: - Homebrew (OS X only) - Install (and setup) many software (Ubuntu only): - Common packages to compress and uncompress common files + - Google Drive command line client - Dropbox - GParted with NTFS support - Mega sync client @@ -67,4 +61,8 @@ With a little of your interaction, EFU will: ## Contributing -The repo uses [this branching model](http://nvie.com/posts/a-successful-git-branching-model/). \ No newline at end of file +The repo uses [this branching model](http://nvie.com/posts/a-successful-git-branching-model/). + +### Testing + +Manually running tests from `test.sh` by: `sh test.sh` \ No newline at end of file diff --git a/Ubuntu/core.sh b/Ubuntu/core.sh index d1eb7e6..f2f5428 100644 --- a/Ubuntu/core.sh +++ b/Ubuntu/core.sh @@ -8,7 +8,7 @@ postInstallationLog "Gnome System Tools" logInfo "Available programs: network-admin, shares-admin, time-admin, users-admin" -log "Installing packages to compress and extract different kind of files..." +logInfo "Installing packages to compress and extract different kind of files..." sudo apt-get -fy install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract @@ -16,16 +16,17 @@ preInstallationLog "GParted with NTFS support" sudo apt-get -fy install gparted ntfs-3g -log "Adding repositories for Rhythmbox and its plugins..." +logInfo "Adding repositories for Rhythmbox and its plugins..." sudo add-apt-repository ppa:fossfreedom/rhythmbox -y sudo add-apt-repository ppa:fossfreedom/rhythmbox-plugins -y sudo apt-get update -log "Instaling latest Rhythmbox and its plugins..." +logInfo "Instaling latest Rhythmbox and its plugins..." sudo apt-get -fy install rhythmbox rhythmbox-plugin-rhythmweb rhythmbox-plugin-equalizer rhythmbox-plugin-opencontainingfolder rhythmbox-plugin-llyrics preInstallationLog "Subdownloader, GMountISO, Freemind (a mind maps editor), Sound Converter, Steam client (will update on first run) and PlayOnLinux" sudo apt-get -fy install subdownloader gmountiso freemind soundconverter steam playonlinux +postInstallationLog "Subdownloader, GMountISO, Freemind (a mind maps editor), Sound Converter, Steam client (will update on first run) and PlayOnLinux" if isUbuntu "$PLATFORM"; then @@ -33,11 +34,11 @@ if isUbuntu "$PLATFORM"; then . ./installAll-15.04.sh fi -log "Cleaning up..." && +logInfo "Cleaning up..." && sudo apt-get -f install && sudo apt-get autoremove && sudo apt-get -y autoclean && sudo apt-get -y clean -log "Updating installed packages..." +logInfo "Updating installed packages..." sudo apt-get upgrade \ No newline at end of file diff --git a/Ubuntu/installAll-14.10.sh b/Ubuntu/installAll-14.10.sh index b2974be..a4d2b3c 100644 --- a/Ubuntu/installAll-14.10.sh +++ b/Ubuntu/installAll-14.10.sh @@ -167,8 +167,6 @@ mv gradle-2.2.1 ~/Coding/xDKs && mv gradle-2.2.1-bin.zip ~/Coding/xDKs && echo 'export GRADLE_HOME=$HOME/Coding/xDKs/gradle-2.2.1' >> ~/.bashrc && echo 'export PATH=$GRADLE_HOME/bin:$PATH' >> ~/.bashrc && -echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties && -echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties && echo "==> - EFU: Successfully added Gradle to path environment variable." echo "==> - EFU: Installing Intellij IDEA Ultimate Edition..." && diff --git a/Ubuntu/installAll-15.04.sh b/Ubuntu/installAll-15.04.sh index 874ac09..0a4e2b5 100644 --- a/Ubuntu/installAll-15.04.sh +++ b/Ubuntu/installAll-15.04.sh @@ -2,16 +2,17 @@ # Created by Nahuel Barrios. -cd ~/Downloads/ || (echo "Failed cding into Downloads directory, exiting..." && exit) +enterDirOrExit ~/Downloads downloadAndInstall "GetDeb" http://archive.getdeb.net/install_deb/getdeb-repository_0.1-1~getdeb1_all.deb downloadAndInstall "PlayDeb" http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb -log "Installing Dropbox, MongoDB and WebP command line tools..." +preInstallationLog "Installing Dropbox, MongoDB and WebP command line tools..." sudo apt-get -fy install nautilus-dropbox mongodb curl webp +postInstallationLog "Installing Dropbox, MongoDB and WebP command line tools..." -cd ~/Downloads/ || (echo "Failed cding into Downloads directory, exiting..." && exit) +enterDirOrExit ~/Downloads downloadAndInstall "Mega Sync client" https://mega.nz/linux/MEGAsync/xUbuntu_15.04/amd64/megasync-xUbuntu_15.04_amd64.deb downloadAndInstall "Mega Nautilus extension" https://mega.nz/linux/MEGAsync/xUbuntu_15.04/amd64/nautilus-megasync-xUbuntu_15.04_amd64.deb downloadAndInstall "TeamViewer" http://www.teamviewer.com/download/teamviewer_linux.deb diff --git a/common.sh b/common.sh index ffc60bd..d4211db 100644 --- a/common.sh +++ b/common.sh @@ -7,39 +7,39 @@ if isOsx "$PLATFORM"; then . modules/homebrew.sh else - log "Installing gdebi package manager..." + logInfo "Installing gdebi package manager..." sudo apt-get -fy install gdebi - log "Updating software sources. Required after adding ppa repositories." + logInfo "Updating software sources. Required after adding ppa repositories." sudo apt-get update - log "Fixing current packages..." + logInfo "Fixing current packages..." sudo apt-get -f install - log "Removing packages that are not necessary to prevent conflicts..." + logInfo "Removing packages that are not necessary to prevent conflicts..." sudo apt-get autoremove - log "#### Software repositories and packages updated ok ####" + logSummary "Software repositories and packages updated ok" fi if isLubuntu "$PLATFORM"; then return 0 fi -# Remember that jq.sh requires Homebrew.sh. -# shellcheck source=modules/jq.sh -. modules/jq.sh - -# Remember that oh-my-zsh.sh requires Homebrew.sh. -# shellcheck source=modules/oh-my-zsh.sh -. modules/oh-my-zsh.sh - # shellcheck source=modules/git.sh . modules/git.sh # shellcheck source=modules/ssh.sh . modules/ssh.sh +# Remember that oh-my-zsh.sh requires Homebrew.sh. +# shellcheck source=modules/oh-my-zsh.sh +. modules/oh-my-zsh/oh-my-zsh.sh + +# Remember that jq.sh requires Homebrew.sh. +# shellcheck source=modules/jq.sh +. modules/jq.sh + # shellcheck source=modules/nodejs.sh . modules/nodejs.sh @@ -52,17 +52,10 @@ fi # shellcheck source=modules/sublime-text.sh . modules/sublime-text.sh -# Remember that go.sh requires Homebrew.sh. -# shellcheck source=modules/go.sh -. modules/go.sh - # Remember that nodejs.sh requires go.sh. # shellcheck source=modules/google-drive.sh . modules/google-drive.sh -# shellcheck source=modules/java.sh -. modules/java.sh - # shellcheck source=modules/gimp.sh . modules/gimp.sh @@ -78,7 +71,11 @@ fi # sdkman at the end because SDKMAN_DIR environment variable must be at the end to work. # shellcheck source=modules/sdkman.sh -. modules/sdkman/sdkman.sh +. modules/sdkman.sh + +# Remember that java.sh requires sdkman.sh. +# shellcheck source=modules/java.sh +. modules/java.sh # Remember that maven.sh requires sdkman.sh. # shellcheck source=modules/maven.sh diff --git a/createDirectoriesTree.sh b/createDirectoriesTree.sh index f84c9ef..c5a992d 100644 --- a/createDirectoriesTree.sh +++ b/createDirectoriesTree.sh @@ -1,16 +1,16 @@ #!/usr/bin/env bash # Created by Nahuel Barrios on 15/04/15. Contact me at: Barrios.Nahuel@gmail.com -log "#### Creating directories tree ####" +logInfo "#### Creating directories tree ####" cd ~/ && -mkdir .gradle || -mkdir Coding || +mkdir .gradle +mkdir Coding cd Coding && -mkdir IDEs || -mkdir xDKs || -mkdir servers || -mkdir tools || -mkdir workspace-mine || -mkdir workspace-test || +mkdir IDEs +mkdir xDKs +mkdir servers +mkdir tools +mkdir workspace-mine +mkdir workspace-test mkdir workspace-work \ No newline at end of file diff --git a/functions.sh b/functions.sh index 1024e86..cf6d7c4 100644 --- a/functions.sh +++ b/functions.sh @@ -2,36 +2,43 @@ # Created by Nahuel Barrios on 15/04/15. # shellcheck disable=SC1090 -log() { - echo "EFU ==> $1 $2 $3" && - echo "EFU ==> $1 $2 $3" >> ~/Downloads/efu.log +logError () { + echo "ERROR - EFU: $1 $2 $3" + echo "ERROR - EFU: $1 $2 $3" >> ~/Downloads/efu.log + echo "ERROR - EFU: $1 $2 $3" >> ~/Downloads/summary.efu.log } -logError() { - echo "EFU ==> ERROR: $1 $2 $3" && - echo "EFU ==> ERROR: $1 $2 $3" >> ~/Downloads/efu.log +logWarn () { + echo "WARN - EFU: $1 $2 $3" + echo "WARN - EFU: $1 $2 $3" >> ~/Downloads/efu.log + echo "WARN - EFU: $1 $2 $3" >> ~/Downloads/summary.efu.log } logInfo (){ - log "$1 $2 $3" - echo "EFU ==> $1 $2 $3" >> ~/Downloads/summary.efu.log + echo "INFO - EFU: $1 $2 $3" + echo "INFO - EFU: $1 $2 $3" >> ~/Downloads/efu.log +} + +logSummary (){ + echo "INFO - EFU: $1 $2 $3" + echo "INFO - EFU: $1 $2 $3" >> ~/Downloads/summary.efu.log } logAlreadyInstalled (){ - log "'$1' already installed. Skipping installation..." + logWarn "'$1' already installed. Skipping installation..." } logProgramVersion (){ - log "$1 $2 $3" - echo "EFU ==> Installed $1 $2 $3" >> ~/Downloads/summary.efu.log + logInfo "$1" "$2" "$3" + logSummary "Installed $1 $2 $3" >> ~/Downloads/summary.efu.log } preInstallationLog(){ - log "Installing $1..." + logInfo "Installing $1..." } postInstallationLog(){ - log "$1 installed ok" + logSummary "$1 installed ok" } isUbuntu(){ @@ -118,7 +125,7 @@ downloadAndUncompress() { ## Parameters: # 1. File name (without path). uncompress(){ - log "Uncompressing $1" + logInfo "Uncompressing $1" # Use the file extension to use unzip or tar to uncompress the file. if [ "$(getFileExtension "$1")" = "zip" ]; then @@ -127,7 +134,7 @@ uncompress(){ tar -zxf "$1" fi - log "$1 uncompressed successfully." + logInfo "$1 uncompressed successfully." } addToShell() { @@ -152,4 +159,11 @@ getGitHubFirstAssetFromLatestRelease(){ # 1. Url to the browser download url. downloadAssetFromGitHub(){ curl -LOk "$1" +} + +enterDirOrExit(){ + if ! cd "$1"; then + echo "Failed cding into $1, exiting..." + exit 1 + fi } \ No newline at end of file diff --git a/install.sh b/install.sh index 2e96db1..f19d361 100644 --- a/install.sh +++ b/install.sh @@ -2,12 +2,25 @@ # Created by Nahuel Barrios on 17/3/16. # shellcheck disable=SC1091 +### +# Clear previous log files +## +if [ -f ~/Downloads/efu.log ]; then + rm ~/Downloads/efu.log +fi + +if [ -f ~/Downloads/summary.efu.log ]; then + rm ~/Downloads/summary.efu.log +fi + + . ./functions.sh -log "To see the installation log run the following in a new tab of your command line: tail –f ~/Downloads/efu.log" -log "Functions loaded OK" +logSummary "Running EFU script at: $(date +%Y-%m-%d_%H-%M-%S)" +logSummary "To see the installation log run the following in a new tab of your command line: tail ~/Downloads/efu.log -f" +logInfo "Functions loaded OK" -log "Checking platform..." +logInfo "Checking platform..." PLATFORM="$1" @@ -18,56 +31,58 @@ fi if isOsx "$PLATFORM"; then - log "Detected platform " - logInfo "Download Transmission torrents client from: https://www.transmissionbt.com/download" - logInfo "Download Mac Fans Control from: http://www.crystalidea.com/macs-fan-control" + logSummary "Detected platform " + logSummary "Download Transmission torrents client from: https://www.transmissionbt.com/download" + logSummary "Download Mac Fans Control from: http://www.crystalidea.com/macs-fan-control" elif isUbuntu "$PLATFORM"; then - log "Detected platform " + logSummary "Detected platform " gnome-terminal --working-directory ~/Downloads --tab -- tail -f efu.log && gnome-terminal --working-directory ~/Downloads --tab -- tail -f summary.efu.log else - log "Detected platform " + logSummary "Detected platform " fi - -logInfo "Download latest JetBrains Intellij IDEA EAP from: https://confluence.jetbrains.com/display/IDEADEV/EAP" -logInfo "Download latest Android Studio from: http://tools.android.com/download/studio/canary/latest" -logInfo "Remember to download the following plugins for both IDEA/Android Studio: .gitignore; MultiMarkDown; IDETalk; WakaTime" -logInfo "Download JDownloader2 from: http://jdownloader.org/download/index" +logSummary "Remember to download the JetBrains toolbox to use either Intellij IDEA, Android Studio or any other IDE. https://www.jetbrains.com/toolbox/app/" +logSummary "Remember to download the following plugins for both IDEA/Android Studio: .gitignore; MultiMarkDown; IDETalk; WakaTime" +logSummary "Download JDownloader2 from: http://jdownloader.org/download/index" # Required because we're moving away from current directory when creating directories or uncompressing software =( CURRENT_DIR="$( cd "$( dirname "$0" )" && pwd )" -log "Creating coding directories tree" +logInfo "Creating coding directories tree" . ./createDirectoriesTree.sh -log "Coding directories tree created ok" +logSummary "Coding directories tree created ok" +if isOsx "$PLATFORM" ; then + logInfo "Setting up Finder app to show hidden files by default" + # This is to show hidden files in Finder (OS X) + defaults write com.apple.finder AppleShowAllFiles YES && + killall Finder && + logSummary "Finder is showing hidden files now." +fi -log "Loading properties file..." -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +logInfo "Loading properties file..." +enterDirOrExit "${CURRENT_DIR}" . ./properties.sh -log "Properties file loaded ok" +logInfo "Properties file loaded ok" -log "Loading common software installation" +logInfo "Loading common software installation" . ./common.sh -log "Common software installed ok" +logInfo "Common software installed ok" -log "Loading $PLATFORM custom installation file..." if isUbuntu "$PLATFORM" ; then + logInfo "Loading $PLATFORM custom installation file..." . ./Ubuntu/core.sh -else - # This is to show hidden files in Finder (OS X) - defaults write com.apple.finder AppleShowAllFiles YES fi logInfo "#### Installation of your favorite software has finished ####" logInfo "Thanks for using me! -- Don't forget to fork me on Github: http://github.com/barriosnahuel/efu" logInfo "To see the installation log run the following on the command line: 'tail –f ~/Downloads/efu.log'" -log "[Important] You should also take a look to: '~/Downloads/summary.efu.log'" +logInfo "[Important] You should also take a look to: '~/Downloads/summary.efu.log'" \ No newline at end of file diff --git a/modules/android.sh b/modules/android.sh index b650ab0..c19723e 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -1,9 +1,9 @@ #!/bin/bash # Created by Nahuel Barrios on 17/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" -log "Configuring Android development environment..." && +logInfo "Configuring Android development environment..." && if isUbuntu "$PLATFORM" ; then @@ -13,77 +13,60 @@ if isUbuntu "$PLATFORM" ; then sudo apt-get -fy install ubuntu-make && umake android && - log "Android SDK installed successfully" + logInfo "Android SDK installed successfully" # This is to stop getting warning messages about iBus daemon. Taken from https://youtrack.jetbrains.com/issue/IDEA-78860 addToShell "# This is to stop getting warning messages about iBus daemon. Taken from https://youtrack.jetbrains.com/issue/IDEA-78860" addToShell "export IBUS_ENABLE_SYNC_MODE=1" else - logInfo "Download Android File Transfer from: https://www.android.com/filetransfer" + logSummary "Download Android File Transfer from: https://www.android.com/filetransfer" fi -log "Configuring Android SDK environment variables..." +logInfo "Configuring Android SDK environment variables..." addToShell "export ANDROID_HOME=\$HOME/Coding/xDKs/android-sdk" addToShell "export PATH=\$ANDROID_HOME/tools:\$PATH" addToShell "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" # This is to be able to use the hierarchy viewer +addToShell "# This is to be able to use the hierarchy viewer" addToShell "export ANDROID_HVPROTO=ddm" -log "Successfully added Android environment variables." +logSummary "Successfully added Android environment variables." -preInstallationLog "Android utilities" +logSummary "Remember you can use Dex2Jar tool: https://github.com/pxb1988/dex2jar" -preInstallationLog "Dex 2 Jar" -# https://github.com/pxb1988/dex2jar - -cd ~/Coding/tools/ || (echo "Failed cding into coding tools directory, exiting..." && exit) -DEX2JAR_DOWNLOAD_URL=$(getGitHubFirstAssetFromLatestRelease "pxb1988/dex2jar") - -# Get file name from url. -FILE_NAME=$(getFileName "$DEX2JAR_DOWNLOAD_URL") && - -downloadAssetFromGitHub "$DEX2JAR_DOWNLOAD_URL" -uncompress "$FILE_NAME" - -DEX2JAR_DIRECTORY="dex2jar-$(getFileName "$(dirname "$DEX2JAR_DOWNLOAD_URL")")" -cd "$DEX2JAR_DIRECTORY" || (echo "Failed cding into dex2jar directory, exiting..." && exit) -chmod +x ./* -addToShell "alias d2j='~/Coding/tools/$DEX2JAR_DIRECTORY/d2j-dex2jar.sh'" - -echo "Usage: d2j-dex2jar.sh -f path/to/your-apk.apk" >> USAGE.txt -echo "More info at: https://github.com/pxb1988/dex2jar" >> USAGE.txt -logInfo "[Android Utilities]: 'd2j' alias created." -postInstallationLog "Dex 2 Jar" - - -preInstallationLog "ClassyShark" +### # https://github.com/google/android-classyshark/ +## +preInstallationLog "ClassyShark" -cd ~/Coding/tools/ || (echo "Failed cding into coding tools directory, exiting..." && exit) +enterDirOrExit ~/Coding/tools/ -mkdir classyshark || (echo "Failed creating into classyshark directory, exiting..." && exit) -cd classyshark || (echo "Failed cding into classyshark directory, exiting..." && exit) +mkdir classyshark +enterDirOrExit classyshark downloadAssetFromGitHub "$(getGitHubFirstAssetFromLatestRelease "google/android-classyshark")" addToShell "alias classyshark='java -jar ~/Coding/tools/classyshark/ClassyShark.jar &'" -logInfo "[Android Utilities]: 'classyshark' alias created." +logSummary "'classyshark' alias created ok" postInstallationLog "ClassyShark" -preInstallationLog "Pidcat Android Logcat decorator" +### # https://github.com/JakeWharton/pidcat +## +preInstallationLog "Pidcat Android Logcat decorator" if isUbuntu "$PLATFORM" ; then - cd ~/Coding/tools/ || (echo "Failed cding into coding tools directory, exiting..." && exit) + enterDirOrExit ~/Coding/tools/ curl -H "Accept: application/vnd.github.v3.raw" \ -LO https://api.github.com/repos/JakeWharton/pidcat/contents/pidcat.py addToShell "alias pidcat='python ~/Coding/tools/pidcat.py'" else brew install pidcat fi -logInfo "[Android Utilities]: run 'pidcat your.application.package' to see an improved logcat. More info at https://github.com/JakeWharton/pidcat" + postInstallationLog "Pidcat Android Logcat decorator" +logSummary "Run 'pidcat your.application.package' to see an improved logcat. More info at https://github.com/JakeWharton/pidcat" -postInstallationLog "Android utilities" \ No newline at end of file +enterDirOrExit "${CURRENT_DIR}" \ No newline at end of file diff --git a/modules/gimp.sh b/modules/gimp.sh index 37d9c75..2c7d285 100644 --- a/modules/gimp.sh +++ b/modules/gimp.sh @@ -1,7 +1,7 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if isUbuntu "$PLATFORM" ; then @@ -10,5 +10,5 @@ if isUbuntu "$PLATFORM" ; then postInstallationLog "Gimp (with some plugins)" else - logInfo "Download Gimp from: https://www.gimp.org/downloads/" + logSummary "Download Gimp from: https://www.gimp.org/downloads/" fi \ No newline at end of file diff --git a/modules/git.sh b/modules/git.sh index fb9cccc..b3dafbc 100644 --- a/modules/git.sh +++ b/modules/git.sh @@ -1,7 +1,7 @@ #!/bin/bash # Created by Nahuel Barrios on 17/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v git >/dev/null; then @@ -14,13 +14,14 @@ if ! command -v git >/dev/null; then xcode-select --install postInstallationLog "Mac OS X Command line tools" fi - - git config --global user.name "$USER_FULL_NAME" && - git config --global user.email "$USER_EMAIL" && - git config --global push.default simple && - log "GIT configured successfully." else - logAlreadyInstalled "git" + logAlreadyInstalled "GIT" fi +git config --global user.name "$USER_FULL_NAME" && +git config --global user.email "$USER_EMAIL" && +git config --global push.default matching && +git config --global core.autocrlf && +logSummary "GIT configured successfully." + logProgramVersion "GIT" "$(git version)" \ No newline at end of file diff --git a/modules/go.sh b/modules/go.sh deleted file mode 100644 index 7f01d50..0000000 --- a/modules/go.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Created by Nahuel Barrios on 24/3/16. - -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) - -if ! command -v go >/dev/null; then - - preInstallationLog "Go language" - - if isUbuntu "$PLATFORM" ; then - - log "Adding repositories for Go language" - - sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable - sudo apt-get update - sudo apt-get -fy install golang - else - brew install go - fi - - addToShell "export GOPATH=\$HOME/Coding/xDKs/gopath" - addToShell "export PATH=/usr/local/go/bin:\$GOPATH/bin:$PATH" - - postInstallationLog "Go language" -else - logAlreadyInstalled "Go Language" -fi - -logProgramVersion "Go" "$(go version)" \ No newline at end of file diff --git a/modules/google-drive.sh b/modules/google-drive.sh index f462f4a..43459f2 100644 --- a/modules/google-drive.sh +++ b/modules/google-drive.sh @@ -1,26 +1,24 @@ #!/bin/bash # Created by Nahuel Barrios on 24/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" -if ! command -v drive >/dev/null; then +if isUbuntu "$PLATFORM" ; then + if ! command -v drive >/dev/null; then - preInstallationLog "Google Drive client" - - if isUbuntu "$PLATFORM" ; then - log "Adding repositories for Google Drive client..." + preInstallationLog "Google Drive client" + logInfo "Adding repositories for Google Drive client..." sudo add-apt-repository ppa:twodopeshaggy/drive sudo apt-get update sudo apt-get -fy install drive + + postInstallationLog "Google Drive client" else - go get -u github.com/odeke-em/drive/cmd/drive + logAlreadyInstalled "Google Drive Client" fi - postInstallationLog "Google Drive client" + logProgramVersion "Google Drive client" "$(drive version)" else - logAlreadyInstalled "Google Drive Client" -fi - -logInfo "See https://github.com/odeke-em/drive#usage to mount your Google Drive directory on your local filesystem" -logProgramVersion "Google Drive client" "$(drive version)" \ No newline at end of file + logSummary "Remember to download the Google Drive client from: https://www.google.com/drive/download/" +fi \ No newline at end of file diff --git a/modules/heroku.sh b/modules/heroku.sh index dbc5983..7dbda5d 100644 --- a/modules/heroku.sh +++ b/modules/heroku.sh @@ -1,7 +1,7 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v heroku >/dev/null; then preInstallationLog "Heroku toolbelt" @@ -13,12 +13,12 @@ if ! command -v heroku >/dev/null; then fi postInstallationLog "Heroku toolbelt" - log "Please login to Heroku with your account." + logWarn "Please login to Heroku with your account." heroku login && - log "Adding existent public keys to Heroku to be able to run commands..." && + logWarn "Adding existent public keys to Heroku to be able to run commands..." && heroku keys:add - log "Heroku account configured successfully." + logSummary "Heroku account configured successfully." else logAlreadyInstalled "Heroku toolbelt" fi diff --git a/modules/homebrew.sh b/modules/homebrew.sh index a2f63cd..8c4cc02 100644 --- a/modules/homebrew.sh +++ b/modules/homebrew.sh @@ -2,7 +2,7 @@ # Created by Nahuel Barrios on 18/3/16. # shellcheck disable=SC1091 -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" preInstallationLog "Homebrew" if ! command -v brew >/dev/null; then @@ -13,15 +13,14 @@ else logAlreadyInstalled "Homebrew" fi -log "Updating Homebrew formulas..." +logInfo "Updating Homebrew formulas..." brew update -log "Verifying the Homebrew installation..." +logInfo "Verifying the Homebrew installation..." if brew doctor; then postInstallationLog "Homebrew" else - log "Your Homebrew installation reported some errors or warnings." - logError "Review the Homebrew messages to see if any action is needed." + logError "Your Homebrew installation reported some errors or warnings, review the Homebrew messages to see if any action is needed." fi logProgramVersion "Homebrew" "$(brew --version)" \ No newline at end of file diff --git a/modules/java.sh b/modules/java.sh index 4f47960..ccf03f9 100644 --- a/modules/java.sh +++ b/modules/java.sh @@ -1,18 +1,16 @@ #!/bin/bash # Created by Nahuel Barrios on 24/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" -if grep "JAVA_HOME" ~/.zshrc; then - logAlreadyInstalled "Java" -else - logInfo "Download latest Java7 from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html" - logInfo "Download latest Java8 from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html" - logInfo "Remember to update JAVA_HOME environment variable after installing Java" +if ! command -v java >/dev/null; then + preInstallationLog "Java" + + sdk install java - log "Setting up Java environment variables..." - addToShell "export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home" - addToShell "export PATH=\$JAVA_HOME/bin:\$PATH" + postInstallationLog "Java" +else + logAlreadyInstalled "Java" fi -logProgramVersion "Java" "$(java version)" \ No newline at end of file +logProgramVersion "Java" "$(java -version)" \ No newline at end of file diff --git a/modules/jq.sh b/modules/jq.sh index 64718e6..716248b 100644 --- a/modules/jq.sh +++ b/modules/jq.sh @@ -1,9 +1,9 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" -preInstallationLog "jq json beautifer" +preInstallationLog "jq JSON beautifer" if isUbuntu "$PLATFORM" ; then sudo apt-get -fy install jq @@ -11,4 +11,4 @@ else brew install jq fi -postInstallationLog "jq json beautifer" \ No newline at end of file +postInstallationLog "jq JSON beautifer" \ No newline at end of file diff --git a/modules/maven.sh b/modules/maven.sh index 9214ab6..fce3186 100644 --- a/modules/maven.sh +++ b/modules/maven.sh @@ -1,14 +1,14 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v mvn >/dev/null; then preInstallationLog "Apache Maven" if isUbuntu "$PLATFORM" ; then - cd ~/Coding/xDKs/ || (echo "Failed cding into xDKs directory, exiting..." && exit) + enterDirOrExit ~/Coding/xDKs/ downloadAndUncompress "Apache Maven" "http://mirrors.nxnethosting.com/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip" && addToShell "export M2_HOME=\$HOME/Coding/xDKs/apache-maven-3.3.9" diff --git a/modules/mixxx.sh b/modules/mixxx.sh index 47d4b49..aec1913 100644 --- a/modules/mixxx.sh +++ b/modules/mixxx.sh @@ -1,18 +1,18 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if isUbuntu "$PLATFORM" ; then preInstallationLog "Mixxx DJ Software" - log "Adding repositories for Mixxx DJ software..." + logInfo "Adding repositories for Mixxx DJ software..." sudo add-apt-repository ppa:mixxx/mixxx -y sudo apt-get update sudo apt-get -fy install mixxx libportaudio2 postInstallationLog "Mixxx DJ Software" else - logInfo "Download Mixxx from: http://www.mixxx.org/download/" + logSummary "Download Mixxx from: http://www.mixxx.org/download/" fi \ No newline at end of file diff --git a/modules/nodejs.sh b/modules/nodejs.sh index 22387c3..72df1b6 100644 --- a/modules/nodejs.sh +++ b/modules/nodejs.sh @@ -1,7 +1,7 @@ #!/bin/bash # Created by Nahuel Barrios on 24/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v nvm >/dev/null; then preInstallationLog "NVM" @@ -35,7 +35,7 @@ logProgramVersion "NVM" "$(nvm version)" logProgramVersion "Node" "$(node -v)" logProgramVersion "NPM" "$(npm -v)" -log "Installing (globally) via the NPM package manager: 'mocha', 'bower' and 'express-generator' modules" +logInfo "Installing (globally) via the NPM package manager: 'mocha', 'bower' and 'express-generator' modules" npm install -g mocha bower express-generator logProgramVersion "Mocha" "$(mocha --version)" diff --git a/modules/oh-my-zsh.sh b/modules/oh-my-zsh.sh deleted file mode 100644 index 0ed67bb..0000000 --- a/modules/oh-my-zsh.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Created by Nahuel Barrios on 24/3/16. - -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) - -preInstallationLog "ZSH" -if isUbuntu "$PLATFORM" ; then - sudo apt-get -fy install zsh -else - brew install zsh -fi - -chsh -s "$(which zsh)" && -postInstallationLog "ZSH" - -# shellcheck disable=SC2016 -log 'Default shell changed to "zsh", to revert change just run: "chsh -s $(which bash)"' - - -preInstallationLog "Oh-My-ZSH" -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -postInstallationLog "Oh-My-ZSH" - - -sed -i -e 's/plugins=(git)/plugins=(git git-extras common-aliases dirhistory)/' ~/.zshrc && -logInfo "Added some plugins to Oh-My-ZSH: git, git-extras, common-aliases, dirhistory." - -sed -i -e 's/ZSH_THEME="robbyrussell"/ZSH_THEME="avit"/' ~/.zshrc && -logInfo 'ZSH Theme changed to "avit", to view more themes go to: https://github.com/robbyrussell/oh-my-zsh/wiki/themes' \ No newline at end of file diff --git a/modules/oh-my-zsh/custom-git.zsh b/modules/oh-my-zsh/custom-git.zsh new file mode 100644 index 0000000..397775e --- /dev/null +++ b/modules/oh-my-zsh/custom-git.zsh @@ -0,0 +1,20 @@ +# You can put files here to add functionality separated per file, which +# will be ignored by git. +# Files on the custom/ directory will be automatically loaded by the init +# script, in alphabetical order. + +# For example: add yourself some shortcuts to projects you often work on. +# +# brainstormr=~/Projects/development/planetargon/brainstormr +# cd $brainstormr +# + +# Outputs current branch info in prompt format +function git_prompt_info() { + local ref + if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then + remote=$(command git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null) || return 0 + + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${remote}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi +} diff --git a/modules/oh-my-zsh/oh-my-zsh.sh b/modules/oh-my-zsh/oh-my-zsh.sh new file mode 100644 index 0000000..cab0135 --- /dev/null +++ b/modules/oh-my-zsh/oh-my-zsh.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + +enterDirOrExit "${CURRENT_DIR}" + +if ! command -v zsh >/dev/null; then + preInstallationLog "ZSH" + + if isUbuntu "$PLATFORM" ; then + sudo apt-get -fy install zsh + else + brew install zsh + fi + + postInstallationLog "ZSH" +else + chsh -s "$(which zsh)" + logAlreadyInstalled "ZSH" +fi + +logProgramVersion "ZSH" "$(zsh --version)" + +# shellcheck disable=SC2016 +logSummary "Default shell changed to 'zsh', to revert change just run: 'chsh -s \$(which bash)'" + + +preInstallationLog "Oh-My-ZSH" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +postInstallationLog "Oh-My-ZSH" + +addToShell "# DEFAULT_USER env var is used to prevent showing the user@machine in some ZSH themes. i.e.: agnoster" +addToShell "export DEFAULT_USER=$MACHINE_USER" + +logInfo "Adding custom GIT info to the terminal" +cp modules/oh-my-zsh/custom-git.zsh ~/.oh-my-zsh/custom/ && +logSummary "Custom GIT info to the terminal added ok" + +sed -i -e 's/plugins=(git)/plugins=(git git-extras common-aliases dirhistory)/' ~/.zshrc && +logSummary "Added some plugins to Oh-My-ZSH: git, git-extras, common-aliases, dirhistory." + +sed -i -e 's/ZSH_THEME="robbyrussell"/ZSH_THEME="avit"/' ~/.zshrc && +logSummary 'ZSH Theme changed to "avit", to view more themes go to: https://github.com/robbyrussell/oh-my-zsh/wiki/themes' \ No newline at end of file diff --git a/modules/ruby.sh b/modules/ruby.sh index e038164..aae5882 100644 --- a/modules/ruby.sh +++ b/modules/ruby.sh @@ -1,7 +1,7 @@ #!/bin/bash # Created by Nahuel Barrios on 15/09/17. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v rvm >/dev/null; then preInstallationLog "RVM" diff --git a/modules/sdkman.sh b/modules/sdkman.sh new file mode 100644 index 0000000..c6c9a46 --- /dev/null +++ b/modules/sdkman.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Created by Nahuel Barrios on 17/3/16. +# shellcheck disable=SC1090 + +enterDirOrExit "${CURRENT_DIR}" + +if ! command -v sdk >/dev/null; then + preInstallationLog "sdkman" + export SDKMAN_DIR="$HOME/Coding/xDKs/sdkman" && curl -s get.sdkman.io | bash && + + # This is required in order to apply previous installs for current terminal session. + source "$SDKMAN_DIR/bin/sdkman-init.sh" + + postInstallationLog "sdkman" +else + logAlreadyInstalled "sdkman" +fi + +logProgramVersion "sdkman" "$(sdk version)" \ No newline at end of file diff --git a/modules/sdkman/gradle.properties b/modules/sdkman/gradle.properties deleted file mode 100644 index bbd1547..0000000 --- a/modules/sdkman/gradle.properties +++ /dev/null @@ -1,17 +0,0 @@ -# The Gradle daemon aims to improve the startup and execution time of Gradle. -# When set to true the Gradle daemon is to run the build. -org.gradle.daemon=true - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -org.gradle.parallel=true -# Enables new incubating mode that makes Gradle selective when configuring projects. -# Only relevant projects are configured which results in faster builds for large multi-projects. -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand -org.gradle.configureondemand=true \ No newline at end of file diff --git a/modules/sdkman/sdkman.sh b/modules/sdkman/sdkman.sh deleted file mode 100644 index 59ebf6f..0000000 --- a/modules/sdkman/sdkman.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Created by Nahuel Barrios on 17/3/16. -# shellcheck disable=SC1090 - -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) - -if ! command -v sdk >/dev/null; then - preInstallationLog "sdkman" - export SDKMAN_DIR="$HOME/Coding/xDKs/sdkman" && curl -s get.sdkman.io | bash && - - source "$HOME/Coding/xDKs/sdkman/bin/sdkman-init.sh" - - postInstallationLog "sdkman" -else - logAlreadyInstalled "sdkman" -fi - -logProgramVersion "sdkman" "$(sdk version)" - -cp modules/sdkman/gradle.properties ~/.gradle/ && -log "Gradle properties created successfully. Check ~/.gradle/gradle.properties to see current configuration" - -# This is required in order to apply previous installs for current terminal session. -source "$HOME/Coding/xDKs/sdkman/bin/sdkman-init.sh" \ No newline at end of file diff --git a/modules/ssh.sh b/modules/ssh.sh index 29da57b..fabb375 100644 --- a/modules/ssh.sh +++ b/modules/ssh.sh @@ -1,9 +1,9 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" -logInfo "Generating a new SSH Key for $USER_EMAIL" && +logWarn "Generating a new SSH Key for $USER_EMAIL" && # Creates a new ssh key, using the provided email as a label ssh-keygen -t rsa -C "$USER_EMAIL" && @@ -14,6 +14,7 @@ eval "$(ssh-agent-s)" && # Finally add the new key. ssh-add ~/.ssh/id_rsa && +logSummary "SSH key added for $USER_EMAIL" if isUbuntu "$PLATFORM" ; then @@ -26,10 +27,10 @@ if isUbuntu "$PLATFORM" ; then fi xclip -sel clip < ~/.ssh/id_rsa.pub - logInfo "SSH Key copied to clipboard. If don't, just run: 'xclip -sel clip < ~/.ssh/id_rsa.pub'" + logSummary "SSH Key copied to clipboard. If don't, just run: 'xclip -sel clip < ~/.ssh/id_rsa.pub'" else # shellcheck disable=SC2002 cat ~/.ssh/id_rsa.pub | pbcopy - logInfo "SSH Key copied to clipboard. If not, just run: 'cat ~/.ssh/id_rsa.pub | pbcopy'" + logSummary "SSH Key copied to clipboard. If not, just run: 'cat ~/.ssh/id_rsa.pub | pbcopy'" fi \ No newline at end of file diff --git a/modules/sublime-text.sh b/modules/sublime-text.sh index 9687a5f..11297e3 100644 --- a/modules/sublime-text.sh +++ b/modules/sublime-text.sh @@ -1,15 +1,19 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if isUbuntu "$PLATFORM" ; then - log "Adding repositories for Sublime Text 3..." + preInstallationLog "Sublime Text 3" + + logInfo "Adding repositories for Sublime Text 3..." sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y sudo apt-get update - log "Instaling Sublime Text 3" + logInfo "Instaling Sublime Text 3" sudo apt-get -fy install sublime-text-installer + + postInstallationLog "Sublime Text 3" else - logInfo "Download Sublime Text from: https://www.sublimetext.com/3" + logSummary "Download Sublime Text from: https://www.sublimetext.com/3" fi \ No newline at end of file diff --git a/modules/tomcat.sh b/modules/tomcat.sh index 353b863..ebfb5db 100644 --- a/modules/tomcat.sh +++ b/modules/tomcat.sh @@ -1,19 +1,21 @@ #!/bin/bash # Created by Nahuel Barrios on 25/3/16. -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" preInstallationLog "Apache Tomcat" -cd ~/Coding/servers/ || (echo "Failed cding into servers directory, exiting..." && exit) +enterDirOrExit ~/Coding/servers/ -TOMCAT_DOWNLOAD_URL=http://apache.dattatec.com/tomcat/tomcat-8/v8.0.33/bin/apache-tomcat-8.0.33.zip +TOMCAT_DOWNLOAD_URL=http://apache.dattatec.com/tomcat/tomcat-9/v9.0.20/bin/apache-tomcat-9.0.20.zip downloadAndUncompress "Apache Tomcat" "$TOMCAT_DOWNLOAD_URL" TOMCAT_DIRECTORY=$(getFileNameWithoutExtension "$(getFileName "$TOMCAT_DOWNLOAD_URL")") -cd ~/Coding/servers/"$TOMCAT_DIRECTORY"/bin || (echo "Failed cding into Tomcat directory, exiting... " && exit) +enterDirOrExit ~/Coding/servers/"$TOMCAT_DIRECTORY"/bin chmod +x catalina.sh && postInstallationLog "Apache Tomcat" -logInfo "Apache Tomcat configured successfully. Now you can run: 'sh startup.sh' and 'sh shutdown.sh'" \ No newline at end of file +logSummary "Now you can run: 'sh startup.sh' and 'sh shutdown.sh' to start/stop Apache Tomcat." + +enterDirOrExit "${CURRENT_DIR}" \ No newline at end of file diff --git a/properties.sh b/properties.sh index b009926..0f9a2ac 100644 --- a/properties.sh +++ b/properties.sh @@ -1,6 +1,11 @@ #!/bin/bash # Created by Nahuel Barrios on 24/3/16. +######################################### +#### Used for some Oh-My-ZSH themes #### +######################################### +MACHINE_USER="nbarrios" + ######################################### #### Will be used for in GIT module. #### #########################################