bin/setup.sh in json_api_toolbox-2.0.0 vs bin/setup.sh in json_api_toolbox-2.0.1

- old
+ new

@@ -1,32 +1,35 @@ #! /bin/sh DEFAULT_REPO=git@bitbucket.org:guideinvestimentos/rails_defaults.git STRICT=${1:-no} ONE_WEEK_AGO=$(( $(date +%s) - 604800 )) -FILE_TIME=$(date +%s -r .rubocop.base.yml 2> /dev/null) +if [ -f .rubocop.base.yml ]; then + FILE_TIME=$(date -r .rubocop.base.yml +%s) +fi + info(){ - echo -e "\\e[34;1m$1\\e[0m" + printf "\033[34;1m$1\033[0m\n" } step(){ - printf "- $1: \\e7\n" + printf " - $1: \0337\n" } success(){ - printf "\\e8\\e[32;1mOK!\\e[0m\n\\e[2K" + printf "\0338\033[1A\033[32;1mOK!\033[0m\n\033[2K" } skipped(){ - printf "\\e8\\e[33;1mSKIPPED ($1)\\e[0m\n\\e[2K" + printf "\0338\033[1A\033[33;1mSKIPPED ($1)\033[0m\n\033[2K" } error() { - printf "\\e8\\e[31;1mERRO!\\e[0m\n\\e[2K" - printf "\\e[31m $1\\e[0m\n" - [ $STRICT == "--strict" ] && exit $2 + printf "\0338\033[1A\033[31;1mERRO!\033[0m\n\033[2K" + printf "\033[31m $1\033[0m\n" + [ $STRICT -eq "--strict" ] && exit $2 } info "Configurando o projeto\n" step "Atualizando configuração base do Rubocop" @@ -46,9 +49,9 @@ step "Instalando dependências" bundle check 2>&1 > /dev/null && skipped "up-to date" || { RESULT=$(bundle install 2>&1 > /dev/null) - [ $? == 0 ] && success || error "$RESULT" 2 + [ $? -eq "0" ] && success || error "$RESULT" 2 } info "\nConfiguração executada com sucesso"