Skip to content

Commit

Permalink
added bat to automatically zip all files for a release
Browse files Browse the repository at this point in the history
  • Loading branch information
sba5827 committed Aug 19, 2023
1 parent a16a23a commit c2cb7b2
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions zip.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
for %%i in ("%~dp0..") do set "folder=%%~fi"

set TEMPDIR=%folder%\temp738
rmdir %TEMPDIR%
mkdir %TEMPDIR%

set FILETOZIP=%~dp0*.lua
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0*.xml
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0*.md
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0*.toc
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0*.blp
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0LICENSE
xcopy %FILETOZIP% %TEMPDIR%\ /Y

set FILETOZIP=%~dp0Libs
xcopy %FILETOZIP% %TEMPDIR%\Libs\ /E /Y

set FILETOZIP=%~dp0Lang
xcopy %FILETOZIP% %TEMPDIR%\Lang\ /E /Y

echo Set objArgs = WScript.Arguments > _zipIt.vbs
echo InputFolder = objArgs(0) >> _zipIt.vbs
echo ZipFile = objArgs(1) >> _zipIt.vbs
echo CreateObject("Scripting.FileSystemObject").CreateTextFile(ZipFile, True).Write "PK" ^& Chr(5) ^& Chr(6) ^& String(18, vbNullChar) >> _zipIt.vbs
echo Set objShell = CreateObject("Shell.Application") >> _zipIt.vbs
echo Set source = objShell.NameSpace(InputFolder).Items >> _zipIt.vbs
echo objShell.NameSpace(ZipFile).CopyHere(source) >> _zipIt.vbs
echo wScript.Sleep 2000 >> _zipIt.vbs

CScript _zipIt.vbs %TEMPDIR% %~dp0StriLi.zip

del /s /f /q %TEMPDIR%\*.*
for /f %%f in ('dir /ad /b %TEMPDIR%') do rd /s /q %TEMPDIR%\%%f

rd /s /q %TEMPDIR%

del %~dp0_zipIt.vbs

pause

0 comments on commit c2cb7b2

Please sign in to comment.