RetroShare/build_scripts/Windows/tools/download-file-wildcard.bat.bat
thunder2 eb95c6895a Windows build environment:
- Renamed folder build_libs to build-libs
- Removed old file stripSVN.sh
- Fixed some batch files
- Switch from curl to wget
- Added Qt environment
- Added build.bat to build everything
2016-11-07 09:42:45 +01:00

47 lines
909 B
Batchfile

:: Usage:
:: call download-file-wildcard.bat url file-wildcard download-path variable
if "%~4"=="" (
echo.
echo Parameter error.
exit /B 1
)
if "%EnvTempPath%"=="" (
echo.
echo Environment error.
exit /B 1
)
setlocal
set Url=%~1
set FileWildcard=%~2
set DownloadPath=%~3
set Var=%~4
set File=
call "%~dp0remove-dir.bat" "%EnvTempPath%"
mkdir "%EnvTempPath%"
"%EnvWgetExe%" --recursive --continue --no-directories --no-parent -A "%FileWildcard%" --directory-prefix="%EnvTempPath%" "%Url%"
if errorlevel 1 (
call "%~dp0remove-dir.bat" "%EnvTempPath%"
endlocal & set %Var%=
exit /B %ERRORLEVEL%
)
for %%A in (%EnvTempPath%\%FileWildcard%) do set File=%%~nxA
if "%File%"=="" (
call "%~dp0remove-dir.bat" "%EnvTempPath%"
endlocal & set %Var%=
exit /B %ERRORLEVEL%
)
move "%EnvTempPath%\%File%" "%DownloadPath%"
call "%~dp0remove-dir.bat" "%EnvTempPath%"
endlocal & set %Var%=%File%
exit /B 0