From 73c60adb1a55169a28ef74f26acf96641fe4bb32 Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Thu, 11 Feb 2016 14:43:40 -0800 Subject: Cleaning up the output of init-tools.sh to mimic the cmd equivalent --- init-tools.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'init-tools.sh') diff --git a/init-tools.sh b/init-tools.sh index 4e3f171557..322a8803e1 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash __scriptpath=$(cd "$(dirname "$0")"; pwd -P) +__init_tools_log=$__scriptpath/init-tools.log __PACKAGES_DIR=$__scriptpath/packages __TOOLRUNTIME_DIR=$__scriptpath/Tools __DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli @@ -42,7 +43,7 @@ esac if [ ! -e $__PROJECT_JSON_FILE ]; then if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi - + echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log if [ ! -e $__DOTNET_PATH ]; then echo "Installing dotnet cli..." # curl has HTTPS CA trust-issues less often than wget, so lets try that first. @@ -65,15 +66,20 @@ if [ ! -e $__PROJECT_JSON_FILE ]; then cd $__scriptpath fi - mkdir "$__PROJECT_JSON_PATH" + if [ ! -e "$__PROJECT_JSON_PATH" ]; then mkdir "$__PROJECT_JSON_PATH"; fi echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" if [ ! -e $__BUILD_TOOLS_PATH ]; then echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." - $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE + echo "Running: $__DOTNET_CMD restore \"$__PROJECT_JSON_FILE\" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE" >> $__init_tools_log + $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE >> $__init_tools_log + if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."; fi fi echo "Initializing BuildTools..." - $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR + echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log + $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log echo "Done initializing tools." +else + echo "Tools are already initialized" fi -- cgit v1.2.3