-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.bat
28 lines (20 loc) · 920 Bytes
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@echo off
cd %cd%
git checkout master
REM get name of current directory
for %%* in (.) do set CurrDirName=%%~nx*
rmdir /S /Q "%temp%\.build\"
del /f /s /q "%cd%\.build\%CurrDirName%.zip"
xcopy /e /s /y "%cd%" "%temp%\.build\%CurrDirName%\" /exclude:exclude.txt
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 "%temp%\.build\" "%cd%\.build\%CurrDirName%.zip"
del "_zipIt.vbs"
echo Success!
call explorer "%cd%\.build\"