aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd
diff options
context:
space:
mode:
authorMarijn Tamis <[email protected]>2017-10-20 14:30:56 +0200
committerMarijn Tamis <[email protected]>2017-10-20 14:36:12 +0200
commitfabb251458f4a2d6d4f87dd36038fac2774b378c (patch)
tree68a4a0ecd940dc949e0477d521d8c159968cfcd5 /NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd
parentNvCloth 1.1.2 Release. (22576033) (diff)
downloadnvcloth-1.1.3.tar.xz
nvcloth-1.1.3.zip
NvCloth 1.1.3 Release. (23014067)v1.1.3
Diffstat (limited to 'NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd')
-rw-r--r--NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd22
1 files changed, 22 insertions, 0 deletions
diff --git a/NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd b/NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd
new file mode 100644
index 0000000..63766c1
--- /dev/null
+++ b/NvCloth/scripts/packman/win-bootstrap/fetch_file_from_s3.cmd
@@ -0,0 +1,22 @@
+:: You need to specify <package-name> <target-path> 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 %1
+@echo Most likely because endpoint cannot be reached (VPN connection down?)
+@endlocal
+@exit /b 1 \ No newline at end of file