Skip to content

Commit

Permalink
Add a script to fetch a remote file
Browse files Browse the repository at this point in the history
The script bootstrap.bat is able to fetch all files or a file from
https://github.com/matortheeternal/TES5Edit to lib/xedit subfolder.
  • Loading branch information
psolyca committed Jan 19, 2018
1 parent 2ed4ef8 commit 342ae95
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions bootstrap.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
@echo off
setlocal enabledelayedexpansion

set "DL_url=https://raw.githubusercontent.com/matortheeternal/TES5Edit/mator-zedit/"
set "folder=lib\xedit\"

:main
if "x%1"=="x" goto usage
if "x%1"=="xhelp" goto usage
if "x%1"=="xall" goto all_files

:single_file
set file=%1
set file=%file:lib\xedit\=%
Call :Download !file!
exit /b

:all_files
:: List of files to fetch
set files[1]=wbBSA.pas
set files[2]=wbDefines.inc
set files[3]=wbDefinitionsFNV.pas
set files[4]=wbDefinitionsFO3.pas
set files[5]=wbDefinitionsFO4.pas
set files[6]=wbDefinitionsTES3.pas
set files[7]=wbDefinitionsTES4.pas
set files[8]=wbDefinitionsTES5.pas
set files[9]=wbHelpers.pas
set files[10]=wbImplementation.pas
set files[11]=wbInit.pas
set files[12]=wbInterface.pas
set files[13]=wbLocalization.pas
set files[14]=wbSort.pas
set files[15]=wbStreams.pas
set files[16]=lz4/lz4.pas
set files[17]=lz4/lz4Common.pas
set files[18]=lz4/lz4frame.pas
set files[19]=lz4/lz4frame_static.pas
set files[20]=lz4/lz4HC.pas
set files[21]=lz4/lz4io.pas
set files[22]=lz4/xxHash.pas
set files[23]=zlib/ZLibEx.inc
set files[24]=zlib/zlibex.pas
set files[25]=zlib/ZLibExApi.pas
set files[26]=zlib/win32/adler32.obj
set files[27]=zlib/win32/compress.obj
set files[28]=zlib/win32/crc32.obj
set files[29]=zlib/win32/deflate.obj
set files[30]=zlib/win32/infback.obj
set files[31]=zlib/win32/inffast.obj
set files[32]=zlib/win32/inflate.obj
set files[33]=zlib/win32/inftrees.obj
set files[34]=zlib/win32/trees.obj
set files[35]=zlib/win64/adler32.obj
set files[36]=zlib/win64/compress.obj
set files[37]=zlib/win64/crc32.obj
set files[38]=zlib/win64/deflate.obj
set files[39]=zlib/win64/infback.obj
set files[40]=zlib/win64/inffast.obj
set files[41]=zlib/win64/inflate.obj
set files[42]=zlib/win64/inftrees.obj
set files[43]=zlib/win64/trees.obj

FOR /L %%i IN (1,1,43) DO (
Call :Download !files[%%i]!
)
exit /b
::*********************************************************************************
:Download <File>
set "URL=%DL_url%%1"
set "file_path=%folder%%1"
set "file_path=!file_path:/=\!"
echo Downloading file "%1" from URL : "%URL%" to : "%file_path%
Powershell.exe -command "(New-Object System.Net.WebClient).DownloadFile('%URL%','%file_path%')"
exit /b
::*************************************************************************

:usage
echo Usage : %0 ^<all^|file^>
echo all : get all files from lib\xedit
echo file : get one file, give the path from git root i.e. lib\xedit\lz4\lz4.pas or lib\xedit\wbBAS.pas
exit /b

0 comments on commit 342ae95

Please sign in to comment.