From 0a9f68a86d34a19d6b6d8d0fe53945a4100330bb Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:00:44 -0300 Subject: [PATCH 01/25] Order modules by priority --- CHANGELOG.md | 4 ++++ common.sh | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1159ef4..74bfda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.3.0 +## Changed +- Order modules by priority at `common.sh`. + # v2.2.0 ## Added - History changelog to let user view the diff. diff --git a/common.sh b/common.sh index ffc60bd..c5e4ff1 100644 --- a/common.sh +++ b/common.sh @@ -26,20 +26,20 @@ 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.sh + +# Remember that jq.sh requires Homebrew.sh. +# shellcheck source=modules/jq.sh +. modules/jq.sh + # shellcheck source=modules/nodejs.sh . modules/nodejs.sh From fa5c1c10661c29d065b473c7ef9284e26694660d Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:03:16 -0300 Subject: [PATCH 02/25] Set GIT properties globally; fixes #66 --- CHANGELOG.md | 3 +++ modules/git.sh | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74bfda6..42578d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Changed - Order modules by priority at `common.sh`. +## Fixed +- GIT properties now are configured ok. #66 + # v2.2.0 ## Added - History changelog to let user view the diff. diff --git a/modules/git.sh b/modules/git.sh index fb9cccc..a4d847b 100644 --- a/modules/git.sh +++ b/modules/git.sh @@ -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" 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 && +log "GIT configured successfully." + logProgramVersion "GIT" "$(git version)" \ No newline at end of file From d767cf14cdebf2b796cda3ade7fec0bfec47f42b Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:05:48 -0300 Subject: [PATCH 03/25] Fix bug when creating directories tree. Only first dir created for each run. --- CHANGELOG.md | 1 + createDirectoriesTree.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42578d9..994aa02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## Fixed - GIT properties now are configured ok. #66 +- Directories tree now is fully created. # v2.2.0 ## Added diff --git a/createDirectoriesTree.sh b/createDirectoriesTree.sh index f84c9ef..d47d2fd 100644 --- a/createDirectoriesTree.sh +++ b/createDirectoriesTree.sh @@ -4,13 +4,13 @@ log "#### 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 From 23de69f8d67b17585aeb08b21624ee3dd7ad1a6c Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:14:24 -0300 Subject: [PATCH 04/25] Relaunch Finder automatically; README improvements; Changed JetBrains links to it's toolbox; --- CHANGELOG.md | 10 ++++++++++ README.md | 11 +++-------- install.sh | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 994aa02..78950e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,20 @@ # v2.3.0 +## Added +- Finder relaunch automatically. + ## 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. ## Fixed - GIT properties now are configured ok. #66 - Directories tree now is fully created. +- Fix `tail` command in README as well as logs. + +## Removed +- Deprecated links and graphics from README. # v2.2.0 ## Added diff --git a/README.md b/README.md index 7fb834e..e1f7873 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. 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.* diff --git a/install.sh b/install.sh index 2e96db1..1572a63 100644 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ # shellcheck disable=SC1091 . ./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 "To see the installation log run the following in a new tab of your command line: tail ~/Downloads/efu.log -f" log "Functions loaded OK" @@ -31,9 +31,7 @@ else log "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 JetBrains toolbox to use either Intellij IDEA, Android Studio or any other IDE. https://www.jetbrains.com/toolbox/app/" 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" @@ -46,6 +44,12 @@ log "Creating coding directories tree" . ./createDirectoriesTree.sh log "Coding directories tree created ok" +if isOsx "$PLATFORM" ; then + log "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 +fi log "Loading properties file..." cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) @@ -58,16 +62,13 @@ log "Loading common software installation" log "Common software installed ok" -log "Loading $PLATFORM custom installation file..." if isUbuntu "$PLATFORM" ; then + log "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'" +log "[Important] You should also take a look to: '~/Downloads/summary.efu.log'" \ No newline at end of file From 0c9c382d0be8784b812f25e8aa5a645ea201c842 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:57:15 -0300 Subject: [PATCH 05/25] Fix how we're cding into directories; --- CHANGELOG.md | 4 +++- Ubuntu/installAll-15.04.sh | 4 ++-- functions.sh | 9 +++++++++ install.sh | 2 +- modules/android.sh | 34 +++++++--------------------------- modules/gimp.sh | 2 +- modules/git.sh | 2 +- modules/go.sh | 2 +- modules/google-drive.sh | 2 +- modules/heroku.sh | 2 +- modules/homebrew.sh | 2 +- modules/java.sh | 2 +- modules/jq.sh | 2 +- modules/maven.sh | 4 ++-- modules/mixxx.sh | 2 +- modules/nodejs.sh | 2 +- modules/oh-my-zsh.sh | 2 +- modules/ruby.sh | 2 +- modules/sdkman/sdkman.sh | 2 +- modules/ssh.sh | 2 +- modules/sublime-text.sh | 2 +- modules/tomcat.sh | 6 +++--- 22 files changed, 42 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78950e3..a9f7ebf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,12 @@ ## Fixed - GIT properties now are configured ok. #66 - Directories tree now is fully created. -- Fix `tail` command in README as well as logs. +- `tail` command in README as well as logs. +- Fallback when cding because currently it's not exiting right. ## Removed - Deprecated links and graphics from README. +- Dex2Jar Android utility in favor of user specific needs. # v2.2.0 ## Added diff --git a/Ubuntu/installAll-15.04.sh b/Ubuntu/installAll-15.04.sh index 874ac09..f443d95 100644 --- a/Ubuntu/installAll-15.04.sh +++ b/Ubuntu/installAll-15.04.sh @@ -2,7 +2,7 @@ # 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 @@ -11,7 +11,7 @@ log "Installing Dropbox, MongoDB and WebP command line tools..." sudo apt-get -fy install nautilus-dropbox mongodb curl webp -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/functions.sh b/functions.sh index 1024e86..dccbd78 100644 --- a/functions.sh +++ b/functions.sh @@ -152,4 +152,13 @@ getGitHubFirstAssetFromLatestRelease(){ # 1. Url to the browser download url. downloadAssetFromGitHub(){ curl -LOk "$1" +} + +enterDirOrExit(){ + cd "$1" + + if [ $? != 0 ]; then + echo "Failed cding into $1, exiting..." + exit $? + fi } \ No newline at end of file diff --git a/install.sh b/install.sh index 1572a63..8d62b99 100644 --- a/install.sh +++ b/install.sh @@ -52,7 +52,7 @@ if isOsx "$PLATFORM" ; then fi log "Loading properties file..." -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" . ./properties.sh log "Properties file loaded ok" diff --git a/modules/android.sh b/modules/android.sh index b650ab0..60d9b04 100644 --- a/modules/android.sh +++ b/modules/android.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}" log "Configuring Android development environment..." && @@ -36,36 +36,15 @@ log "Successfully added Android environment variables." preInstallationLog "Android utilities" -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" - +logInfo "Remember you can use Dex2Jar tool: https://github.com/pxb1988/dex2jar" preInstallationLog "ClassyShark" # https://github.com/google/android-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." @@ -76,13 +55,14 @@ preInstallationLog "Pidcat Android Logcat decorator" # https://github.com/JakeWharton/pidcat 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" diff --git a/modules/gimp.sh b/modules/gimp.sh index 37d9c75..ff782d7 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 diff --git a/modules/git.sh b/modules/git.sh index a4d847b..796e99e 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 diff --git a/modules/go.sh b/modules/go.sh index 7f01d50..2fa3268 100644 --- a/modules/go.sh +++ b/modules/go.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 go >/dev/null; then diff --git a/modules/google-drive.sh b/modules/google-drive.sh index f462f4a..0cbda9b 100644 --- a/modules/google-drive.sh +++ b/modules/google-drive.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 drive >/dev/null; then diff --git a/modules/heroku.sh b/modules/heroku.sh index dbc5983..e6c0117 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" diff --git a/modules/homebrew.sh b/modules/homebrew.sh index a2f63cd..db48f33 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 diff --git a/modules/java.sh b/modules/java.sh index 4f47960..ebce48f 100644 --- a/modules/java.sh +++ b/modules/java.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 grep "JAVA_HOME" ~/.zshrc; then logAlreadyInstalled "Java" diff --git a/modules/jq.sh b/modules/jq.sh index 64718e6..a771290 100644 --- a/modules/jq.sh +++ b/modules/jq.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}" preInstallationLog "jq json beautifer" 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..61d9b29 100644 --- a/modules/mixxx.sh +++ b/modules/mixxx.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 diff --git a/modules/nodejs.sh b/modules/nodejs.sh index 22387c3..36f5bf0 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" diff --git a/modules/oh-my-zsh.sh b/modules/oh-my-zsh.sh index 0ed67bb..ece6a75 100644 --- a/modules/oh-my-zsh.sh +++ b/modules/oh-my-zsh.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}" preInstallationLog "ZSH" if isUbuntu "$PLATFORM" ; then 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/sdkman.sh b/modules/sdkman/sdkman.sh index 59ebf6f..44f85d5 100644 --- a/modules/sdkman/sdkman.sh +++ b/modules/sdkman/sdkman.sh @@ -2,7 +2,7 @@ # Created by Nahuel Barrios on 17/3/16. # shellcheck disable=SC1090 -cd "${CURRENT_DIR}" || (echo "Failed cding into EFU's execution directory, exiting..." && exit) +enterDirOrExit "${CURRENT_DIR}" if ! command -v sdk >/dev/null; then preInstallationLog "sdkman" diff --git a/modules/ssh.sh b/modules/ssh.sh index 29da57b..2f3f01d 100644 --- a/modules/ssh.sh +++ b/modules/ssh.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}" logInfo "Generating a new SSH Key for $USER_EMAIL" && diff --git a/modules/sublime-text.sh b/modules/sublime-text.sh index 9687a5f..bde82a1 100644 --- a/modules/sublime-text.sh +++ b/modules/sublime-text.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 log "Adding repositories for Sublime Text 3..." diff --git a/modules/tomcat.sh b/modules/tomcat.sh index 353b863..2a89632 100644 --- a/modules/tomcat.sh +++ b/modules/tomcat.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}" 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 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" From 1a306de6ce137b367481adcd5d47dd89e6c99e1a Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 18:57:53 -0300 Subject: [PATCH 06/25] Fix how we're cding into directories; --- CHANGELOG.md | 3 ++- modules/android.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9f7ebf..e1bf0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ - 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. +- Fallback when cding because currently it's not exiting right. +- Not going back to EFU's execution directory after installing Android utilities. ## Removed - Deprecated links and graphics from README. diff --git a/modules/android.sh b/modules/android.sh index 60d9b04..af0dcdc 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -66,4 +66,6 @@ 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" -postInstallationLog "Android utilities" \ No newline at end of file +postInstallationLog "Android utilities" + +enterDirOrExit "${CURRENT_DIR}" \ No newline at end of file From dbfaf6afdef868bea75284b1e1d6003daee29994 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 19:03:13 -0300 Subject: [PATCH 07/25] Change OS X Google Drive to a link of the official one --- CHANGELOG.md | 1 + README.md | 2 +- modules/google-drive.sh | 20 +++++++++----------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bf0dc..4561f6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - 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. ## Fixed - GIT properties now are configured ok. #66 diff --git a/README.md b/README.md index e1f7873..bbe2b4e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ With a little of your interaction, EFU will: - 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 @@ -44,6 +43,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 diff --git a/modules/google-drive.sh b/modules/google-drive.sh index 0cbda9b..982c19a 100644 --- a/modules/google-drive.sh +++ b/modules/google-drive.sh @@ -3,24 +3,22 @@ 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 + preInstallationLog "Google Drive client" log "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 + logInfo "Remember to download the Google Drive client from: https://www.google.com/drive/download/" +fi \ No newline at end of file From b7329f4fee280e1cf87dba5998a8c421ca35e954 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 19:04:25 -0300 Subject: [PATCH 08/25] Remove go language --- .travis.yml | 1 - CHANGELOG.md | 1 + README.md | 1 - common.sh | 4 ---- modules/go.sh | 29 ----------------------------- 5 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 modules/go.sh diff --git a/.travis.yml b/.travis.yml index 1c8d6cc..aa14ecc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ script: - 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4561f6a..5c9057b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ ## 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. # v2.2.0 ## Added diff --git a/README.md b/README.md index bbe2b4e..e367eff 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ With a little of your interaction, EFU will: - [Pidcat](https://github.com/JakeWharton/pidcat) - Gimp - GIT - - Go language - Heroku toolbelt - Maven - [Mixxx](http://www.mixxx.org/): DJ software diff --git a/common.sh b/common.sh index c5e4ff1..fa437a6 100644 --- a/common.sh +++ b/common.sh @@ -52,10 +52,6 @@ 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 diff --git a/modules/go.sh b/modules/go.sh deleted file mode 100644 index 2fa3268..0000000 --- a/modules/go.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Created by Nahuel Barrios on 24/3/16. - -enterDirOrExit "${CURRENT_DIR}" - -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 From 9d57552146fdc3216c2ece629d0021df448e871f Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 19:16:09 -0300 Subject: [PATCH 09/25] Remove go language --- CHANGELOG.md | 4 +++- modules/tomcat.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c9057b..9623db4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,13 +8,15 @@ - 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. ## 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. +- Not going back to EFU's execution directory after installing Android utilities. +- Tomcat installation was breaking the script. ## Removed - Deprecated links and graphics from README. diff --git a/modules/tomcat.sh b/modules/tomcat.sh index 2a89632..f5ef6b9 100644 --- a/modules/tomcat.sh +++ b/modules/tomcat.sh @@ -7,7 +7,7 @@ preInstallationLog "Apache Tomcat" 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")") @@ -16,4 +16,6 @@ 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 +logInfo "Apache Tomcat configured successfully. Now you can run: 'sh startup.sh' and 'sh shutdown.sh'" + +enterDirOrExit "${CURRENT_DIR}" \ No newline at end of file From 42b09c7c159c4fd8a73e3bd2cef6e501400880d9 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 19:21:14 -0300 Subject: [PATCH 10/25] Fix java command execution when java is not installed --- CHANGELOG.md | 3 ++- modules/java.sh | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9623db4..49dc58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,8 @@ - `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. +- Tomcat installation was breaking the script. +- `java` command execution on OS X without having it installed. ## Removed - Deprecated links and graphics from README. diff --git a/modules/java.sh b/modules/java.sh index ebce48f..cb441a2 100644 --- a/modules/java.sh +++ b/modules/java.sh @@ -5,6 +5,7 @@ enterDirOrExit "${CURRENT_DIR}" if grep "JAVA_HOME" ~/.zshrc; then logAlreadyInstalled "Java" + logProgramVersion "Java" "$(java version)" 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" @@ -13,6 +14,4 @@ else 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" -fi - -logProgramVersion "Java" "$(java version)" \ No newline at end of file +fi \ No newline at end of file From 602a073d0fd919d96da4930362a7ef46b7a91930 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 20:03:32 -0300 Subject: [PATCH 11/25] Install ZSH only if it's not installed --- CHANGELOG.md | 1 + modules/oh-my-zsh.sh | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49dc58a..d71d6e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - 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. ## Fixed - GIT properties now are configured ok. #66 diff --git a/modules/oh-my-zsh.sh b/modules/oh-my-zsh.sh index ece6a75..f5f078d 100644 --- a/modules/oh-my-zsh.sh +++ b/modules/oh-my-zsh.sh @@ -3,15 +3,22 @@ enterDirOrExit "${CURRENT_DIR}" -preInstallationLog "ZSH" -if isUbuntu "$PLATFORM" ; then - sudo apt-get -fy install zsh +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 - brew install zsh + chsh -s "$(which zsh)" + logAlreadyInstalled "ZSH" fi -chsh -s "$(which zsh)" && -postInstallationLog "ZSH" +logProgramVersion "ZSH" "$(zsh --version)" # shellcheck disable=SC2016 log 'Default shell changed to "zsh", to revert change just run: "chsh -s $(which bash)"' From 93ce3c9d870908cdf628bf3d52abe71946d398d7 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 20:31:12 -0300 Subject: [PATCH 12/25] Comments improvements in .bashrc and .zshrc --- CHANGELOG.md | 1 + modules/android.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71d6e0..e8966cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # v2.3.0 ## Added - Finder relaunch automatically. +- Comments in Android related env vars in .bashrc and .zshrc. ## Changed - Order modules by priority at `common.sh`. diff --git a/modules/android.sh b/modules/android.sh index af0dcdc..4e3b97e 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -29,6 +29,7 @@ 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." From 899ada54768ad11e1e04662cb30fd4d4911c3aed Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 20:59:37 -0300 Subject: [PATCH 13/25] Remove global Gradle properties file --- CHANGELOG.md | 1 + Ubuntu/installAll-14.10.sh | 2 -- common.sh | 2 +- modules/{sdkman => }/sdkman.sh | 3 --- modules/sdkman/gradle.properties | 17 ----------------- 5 files changed, 2 insertions(+), 23 deletions(-) rename modules/{sdkman => }/sdkman.sh (78%) delete mode 100644 modules/sdkman/gradle.properties diff --git a/CHANGELOG.md b/CHANGELOG.md index e8966cc..09c8a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - 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. # v2.2.0 ## Added 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/common.sh b/common.sh index fa437a6..8dd05bf 100644 --- a/common.sh +++ b/common.sh @@ -74,7 +74,7 @@ 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 maven.sh requires sdkman.sh. # shellcheck source=modules/maven.sh diff --git a/modules/sdkman/sdkman.sh b/modules/sdkman.sh similarity index 78% rename from modules/sdkman/sdkman.sh rename to modules/sdkman.sh index 44f85d5..98f8381 100644 --- a/modules/sdkman/sdkman.sh +++ b/modules/sdkman.sh @@ -17,8 +17,5 @@ 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/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 From 883cb6696ed0aeb20fab3e720f554cbf9a42d648 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 21:05:58 -0300 Subject: [PATCH 14/25] Apply shellcheck suggestion --- functions.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions.sh b/functions.sh index dccbd78..b9493ea 100644 --- a/functions.sh +++ b/functions.sh @@ -155,10 +155,8 @@ downloadAssetFromGitHub(){ } enterDirOrExit(){ - cd "$1" - - if [ $? != 0 ]; then + if ! cd "$1"; then echo "Failed cding into $1, exiting..." - exit $? + exit 1 fi } \ No newline at end of file From b2dc7cba5469c753c64bc0a3e4ec21f61e4c96d9 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Sat, 8 Jun 2019 21:22:27 -0300 Subject: [PATCH 15/25] Fix sdkman path in shellcheck setup --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aa14ecc..c1bf88f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ 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 From c66d95faa62f2ec462a99da1d03181da9e1c51a2 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Mon, 10 Jun 2019 21:46:45 -0300 Subject: [PATCH 16/25] Install Java through sdkman --- CHANGELOG.md | 1 + common.sh | 7 ++++--- modules/java.sh | 19 +++++++++---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c8a54..44fd580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - 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. ## Fixed - GIT properties now are configured ok. #66 diff --git a/common.sh b/common.sh index 8dd05bf..e7fc046 100644 --- a/common.sh +++ b/common.sh @@ -56,9 +56,6 @@ fi # 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 @@ -76,6 +73,10 @@ fi # shellcheck source=modules/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 . modules/maven.sh \ No newline at end of file diff --git a/modules/java.sh b/modules/java.sh index cb441a2..ccf03f9 100644 --- a/modules/java.sh +++ b/modules/java.sh @@ -3,15 +3,14 @@ enterDirOrExit "${CURRENT_DIR}" -if grep "JAVA_HOME" ~/.zshrc; then - logAlreadyInstalled "Java" - logProgramVersion "Java" "$(java version)" +if ! command -v java >/dev/null; then + preInstallationLog "Java" + + sdk install java + + postInstallationLog "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" + logAlreadyInstalled "Java" +fi - 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" -fi \ No newline at end of file +logProgramVersion "Java" "$(java -version)" \ No newline at end of file From 8581c444ca4edb6b6565bebcb0a2cf53ac9231e7 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:10:10 -0300 Subject: [PATCH 17/25] Add error/warn/info preffix for logs; Fix duplicated logs; --- README.md | 6 ++++- Ubuntu/core.sh | 10 ++++----- Ubuntu/installAll-15.04.sh | 2 +- common.sh | 10 ++++----- createDirectoriesTree.sh | 2 +- functions.sh | 37 ++++++++++++++++++------------- install.sh | 45 +++++++++++++++++++------------------- modules/android.sh | 8 +++---- modules/git.sh | 2 +- modules/google-drive.sh | 2 +- modules/heroku.sh | 6 ++--- modules/homebrew.sh | 6 ++--- modules/mixxx.sh | 2 +- modules/nodejs.sh | 2 +- modules/sublime-text.sh | 4 ++-- 15 files changed, 78 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index e367eff..5e6c000 100644 --- a/README.md +++ b/README.md @@ -61,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..37f8612 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,11 +16,11 @@ 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 @@ -33,11 +33,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-15.04.sh b/Ubuntu/installAll-15.04.sh index f443d95..9ebb9e3 100644 --- a/Ubuntu/installAll-15.04.sh +++ b/Ubuntu/installAll-15.04.sh @@ -7,7 +7,7 @@ downloadAndInstall "GetDeb" http://archive.getdeb.net/install_deb/getdeb-reposit downloadAndInstall "PlayDeb" http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb -log "Installing Dropbox, MongoDB and WebP command line tools..." +logInfo "Installing Dropbox, MongoDB and WebP command line tools..." sudo apt-get -fy install nautilus-dropbox mongodb curl webp diff --git a/common.sh b/common.sh index e7fc046..8caf8a3 100644 --- a/common.sh +++ b/common.sh @@ -7,19 +7,19 @@ 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 ####" + logInfo "#### Software repositories and packages updated ok ####" fi if isLubuntu "$PLATFORM"; then diff --git a/createDirectoriesTree.sh b/createDirectoriesTree.sh index d47d2fd..c5a992d 100644 --- a/createDirectoriesTree.sh +++ b/createDirectoriesTree.sh @@ -1,7 +1,7 @@ #!/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 diff --git a/functions.sh b/functions.sh index b9493ea..eee0546 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" + logInfo "$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() { diff --git a/install.sh b/install.sh index 8d62b99..5d1b272 100644 --- a/install.sh +++ b/install.sh @@ -3,11 +3,11 @@ # shellcheck disable=SC1091 . ./functions.sh -log "To see the installation log run the following in a new tab of your command line: tail ~/Downloads/efu.log -f" -log "Functions loaded OK" +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,52 +18,53 @@ 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 "Remember to download the JetBrains toolbox to use either Intellij IDEA, Android Studio or any other IDE. https://www.jetbrains.com/toolbox/app/" -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 - log "Setting up Finder app to show hidden files by default" + 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 + defaults write com.apple.finder AppleShowAllFiles YES && + killall Finder && + logSummary "Finder is showing hidden files now." fi -log "Loading properties file..." +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" if isUbuntu "$PLATFORM" ; then - log "Loading $PLATFORM custom installation file..." + logInfo "Loading $PLATFORM custom installation file..." . ./Ubuntu/core.sh fi @@ -71,4 +72,4 @@ 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'" \ No newline at end of file +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 4e3b97e..b57f5da 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -3,7 +3,7 @@ enterDirOrExit "${CURRENT_DIR}" -log "Configuring Android development environment..." && +logInfo "Configuring Android development environment..." && if isUbuntu "$PLATFORM" ; then @@ -13,7 +13,7 @@ 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" @@ -22,7 +22,7 @@ else logInfo "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" @@ -32,7 +32,7 @@ addToShell "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" addToShell "# This is to be able to use the hierarchy viewer" addToShell "export ANDROID_HVPROTO=ddm" -log "Successfully added Android environment variables." +logInfo "Successfully added Android environment variables." preInstallationLog "Android utilities" diff --git a/modules/git.sh b/modules/git.sh index 796e99e..8a2b80b 100644 --- a/modules/git.sh +++ b/modules/git.sh @@ -22,6 +22,6 @@ 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 && -log "GIT configured successfully." +logInfo "GIT configured successfully." logProgramVersion "GIT" "$(git version)" \ No newline at end of file diff --git a/modules/google-drive.sh b/modules/google-drive.sh index 982c19a..8939ba8 100644 --- a/modules/google-drive.sh +++ b/modules/google-drive.sh @@ -7,7 +7,7 @@ if isUbuntu "$PLATFORM" ; then if ! command -v drive >/dev/null; then preInstallationLog "Google Drive client" - log "Adding repositories for Google Drive client..." + logInfo "Adding repositories for Google Drive client..." sudo add-apt-repository ppa:twodopeshaggy/drive sudo apt-get update diff --git a/modules/heroku.sh b/modules/heroku.sh index e6c0117..52b2135 100644 --- a/modules/heroku.sh +++ b/modules/heroku.sh @@ -13,12 +13,12 @@ if ! command -v heroku >/dev/null; then fi postInstallationLog "Heroku toolbelt" - log "Please login to Heroku with your account." + logInfo "Please login to Heroku with your account." heroku login && - log "Adding existent public keys to Heroku to be able to run commands..." && + logInfo "Adding existent public keys to Heroku to be able to run commands..." && heroku keys:add - log "Heroku account configured successfully." + logInfo "Heroku account configured successfully." else logAlreadyInstalled "Heroku toolbelt" fi diff --git a/modules/homebrew.sh b/modules/homebrew.sh index db48f33..6565442 100644 --- a/modules/homebrew.sh +++ b/modules/homebrew.sh @@ -13,14 +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." + logInfo "Your Homebrew installation reported some errors or warnings." logError "Review the Homebrew messages to see if any action is needed." fi diff --git a/modules/mixxx.sh b/modules/mixxx.sh index 61d9b29..82dcb09 100644 --- a/modules/mixxx.sh +++ b/modules/mixxx.sh @@ -7,7 +7,7 @@ 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 diff --git a/modules/nodejs.sh b/modules/nodejs.sh index 36f5bf0..72df1b6 100644 --- a/modules/nodejs.sh +++ b/modules/nodejs.sh @@ -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/sublime-text.sh b/modules/sublime-text.sh index bde82a1..5706b10 100644 --- a/modules/sublime-text.sh +++ b/modules/sublime-text.sh @@ -4,11 +4,11 @@ enterDirOrExit "${CURRENT_DIR}" if isUbuntu "$PLATFORM" ; then - log "Adding repositories for 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 else logInfo "Download Sublime Text from: https://www.sublimetext.com/3" From f84299d82b7925754983127daa5142a1c12558dc Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:31:58 -0300 Subject: [PATCH 18/25] Add many logs to the summary --- Ubuntu/core.sh | 1 + Ubuntu/installAll-15.04.sh | 3 ++- common.sh | 2 +- functions.sh | 2 +- modules/android.sh | 22 +++++++++++----------- modules/gimp.sh | 2 +- modules/git.sh | 4 ++-- modules/google-drive.sh | 2 +- modules/heroku.sh | 6 +++--- modules/homebrew.sh | 3 +-- modules/jq.sh | 4 ++-- modules/mixxx.sh | 2 +- modules/oh-my-zsh.sh | 6 +++--- modules/ssh.sh | 7 ++++--- modules/sublime-text.sh | 6 +++++- modules/tomcat.sh | 2 +- 16 files changed, 40 insertions(+), 34 deletions(-) diff --git a/Ubuntu/core.sh b/Ubuntu/core.sh index 37f8612..f2f5428 100644 --- a/Ubuntu/core.sh +++ b/Ubuntu/core.sh @@ -26,6 +26,7 @@ sudo apt-get -fy install rhythmbox rhythmbox-plugin-rhythmweb rhythmbox-plugin-e 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 diff --git a/Ubuntu/installAll-15.04.sh b/Ubuntu/installAll-15.04.sh index 9ebb9e3..0a4e2b5 100644 --- a/Ubuntu/installAll-15.04.sh +++ b/Ubuntu/installAll-15.04.sh @@ -7,8 +7,9 @@ downloadAndInstall "GetDeb" http://archive.getdeb.net/install_deb/getdeb-reposit downloadAndInstall "PlayDeb" http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb -logInfo "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..." enterDirOrExit ~/Downloads diff --git a/common.sh b/common.sh index 8caf8a3..eb710e8 100644 --- a/common.sh +++ b/common.sh @@ -19,7 +19,7 @@ else logInfo "Removing packages that are not necessary to prevent conflicts..." sudo apt-get autoremove - logInfo "#### Software repositories and packages updated ok ####" + logSummary "Software repositories and packages updated ok" fi if isLubuntu "$PLATFORM"; then diff --git a/functions.sh b/functions.sh index eee0546..cf6d7c4 100644 --- a/functions.sh +++ b/functions.sh @@ -38,7 +38,7 @@ preInstallationLog(){ } postInstallationLog(){ - logInfo "$1 installed ok" + logSummary "$1 installed ok" } isUbuntu(){ diff --git a/modules/android.sh b/modules/android.sh index b57f5da..c19723e 100644 --- a/modules/android.sh +++ b/modules/android.sh @@ -19,7 +19,7 @@ if isUbuntu "$PLATFORM" ; then 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 logInfo "Configuring Android SDK environment variables..." @@ -32,15 +32,15 @@ addToShell "export PATH=\$ANDROID_HOME/platform-tools:\$PATH" addToShell "# This is to be able to use the hierarchy viewer" addToShell "export ANDROID_HVPROTO=ddm" -logInfo "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" -logInfo "Remember you can use Dex2Jar tool: https://github.com/pxb1988/dex2jar" - -preInstallationLog "ClassyShark" +### # https://github.com/google/android-classyshark/ +## +preInstallationLog "ClassyShark" enterDirOrExit ~/Coding/tools/ @@ -48,12 +48,14 @@ 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 enterDirOrExit ~/Coding/tools/ @@ -64,9 +66,7 @@ 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" - -postInstallationLog "Android utilities" +logSummary "Run 'pidcat your.application.package' to see an improved logcat. More info at https://github.com/JakeWharton/pidcat" enterDirOrExit "${CURRENT_DIR}" \ No newline at end of file diff --git a/modules/gimp.sh b/modules/gimp.sh index ff782d7..2c7d285 100644 --- a/modules/gimp.sh +++ b/modules/gimp.sh @@ -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 8a2b80b..b3dafbc 100644 --- a/modules/git.sh +++ b/modules/git.sh @@ -15,13 +15,13 @@ if ! command -v git >/dev/null; then postInstallationLog "Mac OS X Command line tools" fi 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 && -logInfo "GIT configured successfully." +logSummary "GIT configured successfully." logProgramVersion "GIT" "$(git version)" \ No newline at end of file diff --git a/modules/google-drive.sh b/modules/google-drive.sh index 8939ba8..43459f2 100644 --- a/modules/google-drive.sh +++ b/modules/google-drive.sh @@ -20,5 +20,5 @@ if isUbuntu "$PLATFORM" ; then logProgramVersion "Google Drive client" "$(drive version)" else - logInfo "Remember to download the Google Drive client from: https://www.google.com/drive/download/" + 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 52b2135..7dbda5d 100644 --- a/modules/heroku.sh +++ b/modules/heroku.sh @@ -13,12 +13,12 @@ if ! command -v heroku >/dev/null; then fi postInstallationLog "Heroku toolbelt" - logInfo "Please login to Heroku with your account." + logWarn "Please login to Heroku with your account." heroku login && - logInfo "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 - logInfo "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 6565442..8c4cc02 100644 --- a/modules/homebrew.sh +++ b/modules/homebrew.sh @@ -20,8 +20,7 @@ logInfo "Verifying the Homebrew installation..." if brew doctor; then postInstallationLog "Homebrew" else - logInfo "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/jq.sh b/modules/jq.sh index a771290..716248b 100644 --- a/modules/jq.sh +++ b/modules/jq.sh @@ -3,7 +3,7 @@ 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/mixxx.sh b/modules/mixxx.sh index 82dcb09..aec1913 100644 --- a/modules/mixxx.sh +++ b/modules/mixxx.sh @@ -14,5 +14,5 @@ if isUbuntu "$PLATFORM" ; then 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/oh-my-zsh.sh b/modules/oh-my-zsh.sh index f5f078d..46ea22f 100644 --- a/modules/oh-my-zsh.sh +++ b/modules/oh-my-zsh.sh @@ -21,7 +21,7 @@ fi logProgramVersion "ZSH" "$(zsh --version)" # shellcheck disable=SC2016 -log 'Default shell changed to "zsh", to revert change just run: "chsh -s $(which bash)"' +logSummary "Default shell changed to 'zsh', to revert change just run: 'chsh -s \$(which bash)'" preInstallationLog "Oh-My-ZSH" @@ -30,7 +30,7 @@ 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." +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 && -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 +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/ssh.sh b/modules/ssh.sh index 2f3f01d..fabb375 100644 --- a/modules/ssh.sh +++ b/modules/ssh.sh @@ -3,7 +3,7 @@ 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 5706b10..11297e3 100644 --- a/modules/sublime-text.sh +++ b/modules/sublime-text.sh @@ -4,12 +4,16 @@ enterDirOrExit "${CURRENT_DIR}" if isUbuntu "$PLATFORM" ; then + 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 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 f5ef6b9..ebfb5db 100644 --- a/modules/tomcat.sh +++ b/modules/tomcat.sh @@ -16,6 +16,6 @@ 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'" +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 From afc85bc34e3cb68ce8d0d7077c2fd69e23a1f157 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:32:20 -0300 Subject: [PATCH 19/25] Remove duplicated sh compilation when installing sdkman --- modules/sdkman.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/sdkman.sh b/modules/sdkman.sh index 98f8381..c6c9a46 100644 --- a/modules/sdkman.sh +++ b/modules/sdkman.sh @@ -8,14 +8,12 @@ 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" + # 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)" - -# 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 +logProgramVersion "sdkman" "$(sdk version)" \ No newline at end of file From 6fe99c53ceac8fa0a047647206802de1bcab0f63 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:44:12 -0300 Subject: [PATCH 20/25] Clear previous log files on each run. closes #90 --- install.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/install.sh b/install.sh index 5d1b272..f19d361 100644 --- a/install.sh +++ b/install.sh @@ -2,7 +2,20 @@ # 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 +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" From 88af93886228db6fbb2cb3ce397236349b41394c Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:49:34 -0300 Subject: [PATCH 21/25] Add changes to the CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44fd580..24fd87b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Added - Finder relaunch automatically. - Comments in Android related env vars in .bashrc and .zshrc. +- ERROR/WARN/INFO preffix for logs. ## Changed - Order modules by priority at `common.sh`. @@ -12,6 +13,7 @@ - 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 @@ -21,12 +23,14 @@ - 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 From ad1e55b621ac2a3157eee89daa28ad28725c8e6c Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 00:56:16 -0300 Subject: [PATCH 22/25] Add base test.sh script for manual testing purposes --- test.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test.sh diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..70a2ef0 --- /dev/null +++ b/test.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +### +# Setup method for testing purposes. +# Compiles functions in order to be able to test prod files. +## +setup () { + . ./functions.sh +} + +setup + +### +# Code your test after this comment... +## + From bb7fecc8a9ede06688706bf485fedc754bae5ecf Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 01:12:52 -0300 Subject: [PATCH 23/25] Remove test.sh from GIT --- test.sh | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 test.sh diff --git a/test.sh b/test.sh deleted file mode 100644 index 70a2ef0..0000000 --- a/test.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -### -# Setup method for testing purposes. -# Compiles functions in order to be able to test prod files. -## -setup () { - . ./functions.sh -} - -setup - -### -# Code your test after this comment... -## - From df553ae8f9bbb3cdc92060f889b63abe7f622e16 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 01:13:38 -0300 Subject: [PATCH 24/25] Add DEFAULT_USER env var for agnoster theme. closes #74 --- CHANGELOG.md | 1 + README.md | 2 +- modules/oh-my-zsh.sh | 2 ++ properties.sh | 5 +++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24fd87b..8b77471 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Finder relaunch automatically. - Comments in Android related env vars in .bashrc and .zshrc. - ERROR/WARN/INFO preffix for logs. +- `DEFAULT_USER` environment variable. #74 ## Changed - Order modules by priority at `common.sh`. diff --git a/README.md b/README.md index 5e6c000..e9dea51 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ EFU (Easy-Fast-Upgradable): The SH script you need to finish your Ubuntu/MacOS X ## 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]` 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` diff --git a/modules/oh-my-zsh.sh b/modules/oh-my-zsh.sh index 46ea22f..ec2f709 100644 --- a/modules/oh-my-zsh.sh +++ b/modules/oh-my-zsh.sh @@ -28,6 +28,8 @@ 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" 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." 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. #### ######################################### From 83fa9ff2b40b61d2f52e323e9dccf755b639ed11 Mon Sep 17 00:00:00 2001 From: Nahuel Barrios Date: Wed, 12 Jun 2019 01:58:52 -0300 Subject: [PATCH 25/25] Add GIT remote to the oh-my-zsh setup --- .travis.yml | 2 +- CHANGELOG.md | 1 + common.sh | 2 +- modules/oh-my-zsh/custom-git.zsh | 20 ++++++++++++++++++++ modules/{ => oh-my-zsh}/oh-my-zsh.sh | 4 ++++ 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 modules/oh-my-zsh/custom-git.zsh rename modules/{ => oh-my-zsh}/oh-my-zsh.sh (88%) diff --git a/.travis.yml b/.travis.yml index c1bf88f..3a60326 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,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 8b77471..013679e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - 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`. diff --git a/common.sh b/common.sh index eb710e8..d4211db 100644 --- a/common.sh +++ b/common.sh @@ -34,7 +34,7 @@ fi # Remember that oh-my-zsh.sh requires Homebrew.sh. # shellcheck source=modules/oh-my-zsh.sh -. 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 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.sh b/modules/oh-my-zsh/oh-my-zsh.sh similarity index 88% rename from modules/oh-my-zsh.sh rename to modules/oh-my-zsh/oh-my-zsh.sh index ec2f709..cab0135 100644 --- a/modules/oh-my-zsh.sh +++ b/modules/oh-my-zsh/oh-my-zsh.sh @@ -31,6 +31,10 @@ 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."