From 6445e82cceae75fa07fe5123ee290579c78864d5 Mon Sep 17 00:00:00 2001 From: chcosta Date: Thu, 25 Aug 2016 13:14:39 -0700 Subject: Enable init-tools option to suppress non-error output from the console output (#11059) * Enable option to suppress non-error output from the console output for init-tools. * Redirect standard output to log * Remove unneccesary arg * Add Linux init-tools changes * revert dotnet to x64 * Remove echo line from run.sh --- init-tools.cmd | 10 +++++----- init-tools.sh | 11 +++++------ run.cmd | 1 - run.sh | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/init-tools.cmd b/init-tools.cmd index 87d989982b..352802c8d0 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -22,7 +22,7 @@ if [%1]==[force] ( :: If sempahore exists do nothing if exist "%BUILD_TOOLS_SEMAPHORE%" ( - echo Tools are already initialized. + echo Tools are already initialized. >> "%INIT_TOOLS_LOG%" goto :EOF ) @@ -34,7 +34,7 @@ echo Running %0 > "%INIT_TOOLS_LOG%" if exist "%DOTNET_CMD%" goto :afterdotnetrestore -echo Installing dotnet cli... +echo Installing dotnet cli... >> "%INIT_TOOLS_LOG%" if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%" set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt" set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip @@ -50,7 +50,7 @@ if NOT exist "%DOTNET_LOCAL_PATH%" ( :afterdotnetrestore if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore -echo Restoring BuildTools version %BUILDTOOLS_VERSION%... +echo Restoring BuildTools version %BUILDTOOLS_VERSION%... >> "%INIT_TOOLS_LOG%" echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%" call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%" if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" ( @@ -60,7 +60,7 @@ if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" ( :afterbuildtoolsrestore -echo Initializing BuildTools ... +echo Initializing BuildTools ... >> "%INIT_TOOLS_LOG%" echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%" call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%" set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL% @@ -70,5 +70,5 @@ if not [%INIT_TOOLS_ERRORLEVEL%]==[0] ( ) :: Create sempahore file -echo Done initializing tools. +echo Done initializing tools. >> "%INIT_TOOLS_LOG%" echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%" \ No newline at end of file diff --git a/init-tools.sh b/init-tools.sh index c422801ecd..aa42892213 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -47,12 +47,11 @@ OSName=$(uname -s) ;; esac fi - if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; 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..." + echo "Installing dotnet cli..." >> $__init_tools_log __DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz" # curl has HTTPS CA trust-issues less often than wget, so lets try that first. echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log @@ -73,13 +72,13 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" if [ ! -e $__BUILD_TOOLS_PATH ]; then - echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." + echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." >> $__init_tools_log echo "Running: $__DOTNET_CMD restore \"$__PROJECT_JSON_FILE\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE" >> $__init_tools_log $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --no-cache --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..." + echo "Initializing BuildTools..." >> $__init_tools_log 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 if [ "$?" != "0" ]; then @@ -87,7 +86,7 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then exit 1 fi touch $__INIT_TOOLS_DONE_MARKER - echo "Done initializing tools." + echo "Done initializing tools." >> $__init_tools_log else - echo "Tools are already initialized" + echo "Tools are already initialized" > $__init_tools_log fi diff --git a/run.cmd b/run.cmd index b532968157..a0ddf00d9d 100644 --- a/run.cmd +++ b/run.cmd @@ -23,6 +23,5 @@ if NOT [%ERRORLEVEL%]==[0] exit /b 1 set _toolRuntime=%~dp0Tools set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe -echo Running: %_dotnet% %_toolRuntime%\run.exe %* call %_dotnet% %_toolRuntime%\run.exe %* exit /b %ERRORLEVEL% \ No newline at end of file diff --git a/run.sh b/run.sh index 64354936ff..cd70f8bcf8 100755 --- a/run.sh +++ b/run.sh @@ -9,6 +9,5 @@ fi __toolRuntime=$__scriptpath/Tools __dotnet=$__toolRuntime/dotnetcli/dotnet -echo Running: $__dotnet $__toolRuntime/run.exe $* $__dotnet $__toolRuntime/run.exe $* exit $? -- cgit v1.2.3