From 7115f60b91b5717d90f643fd692010905c7004db Mon Sep 17 00:00:00 2001 From: Bryan Galdrikian Date: Thu, 31 May 2018 11:36:08 -0700 Subject: Blast 1.1.3. See docs/release_notes.txt. --- .../packman5/win-bootstrap/fetch_file_from_s3.cmd | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd (limited to 'buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd') diff --git a/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd new file mode 100755 index 0000000..90f717a --- /dev/null +++ b/buildtools/packman5/win-bootstrap/fetch_file_from_s3.cmd @@ -0,0 +1,22 @@ +:: You need to specify as input to this command +@setlocal +@set PACKAGE_NAME=%1 +@set TARGET_PATH=%2 + +@echo Fetching %PACKAGE_NAME% from S3 ... + +@powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0fetch_file_from_s3.ps1" -sourceName %PACKAGE_NAME% ^ + -output %TARGET_PATH% +:: A bug in powershell prevents the errorlevel code from being set when using the -File execution option +:: We must therefore do our own failure analysis, basically make sure the file exists and is larger than 0 bytes: +@if not exist %TARGET_PATH% goto ERROR_DOWNLOAD_FAILED +@if %~z2==0 goto ERROR_DOWNLOAD_FAILED + +@endlocal +@exit /b 0 + +:ERROR_DOWNLOAD_FAILED +@echo Failed to download file from S3 +@echo Most likely because endpoint cannot be reached or file %PACKAGE_NAME% doesn't exist +@endlocal +@exit /b 1 \ No newline at end of file -- cgit v1.2.3