From 1afc729663086b246e6c4e1684dc877e53ae2c8f Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Thu, 19 Mar 2020 19:30:50 +0100 Subject: [PATCH] Fix linting errors Signed-off-by: Severin Kaderli --- .install/composer.sh | 2 +- .install/lib/lib.sh | 3 ++- .install/lib/output.sh | 2 +- .install/npm.sh | 2 +- .install/ruby.sh | 2 +- .install/rust.sh | 2 +- install | 7 +++++-- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.install/composer.sh b/.install/composer.sh index 083b8f3..0cb0c5d 100644 --- a/.install/composer.sh +++ b/.install/composer.sh @@ -17,7 +17,7 @@ output::section "Composer" if output::prompt "Do you want to install global composer packages?"; then output::log "Installing ${#CONFIG_COMPOSER_PACKAGES[@]} packages" - output::list ${CONFIG_COMPOSER_PACKAGES[@]} + output::list "${CONFIG_COMPOSER_PACKAGES[@]}" composer global require "${CONFIG_COMPOSER_PACKAGES[@]}" |& output::debug output::success "Packages successfully installed" fi \ No newline at end of file diff --git a/.install/lib/lib.sh b/.install/lib/lib.sh index aace156..35f262a 100644 --- a/.install/lib/lib.sh +++ b/.install/lib/lib.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -declare LIB_DIR="$(dirname "${BASH_SOURCE[0]}")" +declare LIB_DIR +LIB_DIR="$(dirname "${BASH_SOURCE[0]}")" source "${LIB_DIR}/output.sh" \ No newline at end of file diff --git a/.install/lib/output.sh b/.install/lib/output.sh index c564ea5..d53d0fe 100755 --- a/.install/lib/output.sh +++ b/.install/lib/output.sh @@ -31,7 +31,7 @@ output::success() { } output::question() { - printf " ${YELLOW}${1}${DEFAULT}" |& tee -a "${INSTALL_LOG}" + echo -e " ${YELLOW}${1}${DEFAULT}\c" |& tee -a "${INSTALL_LOG}" } output::error() { diff --git a/.install/npm.sh b/.install/npm.sh index 837e61f..a6f2bd9 100644 --- a/.install/npm.sh +++ b/.install/npm.sh @@ -20,7 +20,7 @@ output::section "NPM" if output::prompt "Do you want to install global npm packages?"; then output::log "Installing ${#CONFIG_NPM_PACKAGES[@]} packages" - output::list ${CONFIG_NPM_PACKAGES[@]} + output::list "${CONFIG_NPM_PACKAGES[@]}" npm i -g "${CONFIG_NPM_PACKAGES[@]}" |& output::debug output::success "Packages successfully installed" fi \ No newline at end of file diff --git a/.install/ruby.sh b/.install/ruby.sh index deb5d02..149bf55 100644 --- a/.install/ruby.sh +++ b/.install/ruby.sh @@ -15,7 +15,7 @@ output::section "Ruby" if output::prompt "Do you want to install ruby gems?"; then output::log "Installing ${#CONFIG_RUBY_GEMS[@]} gems" - output::list ${CONFIG_RUBY_GEMS[@]} + output::list "${CONFIG_RUBY_GEMS[@]}" gem install "${CONFIG_RUBY_GEMS[@]}" |& output::debug output::success "Gems successfully installed" fi \ No newline at end of file diff --git a/.install/rust.sh b/.install/rust.sh index 9043e97..9655098 100644 --- a/.install/rust.sh +++ b/.install/rust.sh @@ -25,7 +25,7 @@ if output::prompt "Do you want to install a Rust toolchain?"; then output::success "Rust toolchain was installed and activated" output::log "Installing components for Rust" - output::list ${CONFIG_RUST_COMPONENTS[@]} + output::list "${CONFIG_RUST_COMPONENTS[@]}" rustup -q component add "${CONFIG_RUST_COMPONENTS[@]}" |& output::debug output::success "Rust components were successfully installed" fi \ No newline at end of file diff --git a/install b/install index 7c46003..b574450 100755 --- a/install +++ b/install @@ -13,7 +13,9 @@ # # USAGE: # ./install -declare DOT_DIR="$(dirname "${BASH_SOURCE[0]}" | cd | pwd)" +declare DOT_DIR +DOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" || exit; pwd)" + declare INSTALL_DIR="${DOT_DIR}/.install" declare SYSTEM_DIR="${DOT_DIR}/system" INSTALL_LOG="${XDG_LOG_HOME}/install.log" @@ -67,4 +69,5 @@ source "${INSTALL_DIR}/shell.sh" output::section "Post installation information" echo "${BOLD}Make sure you do the following after this installation:" echo " • Download settings for Visual Studio Code" -echo " • Reboot the system" \ No newline at end of file +echo " • Reboot the system" +