-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path5_crossbrowdy_examples_zip.bat
50 lines (39 loc) · 1.69 KB
/
5_crossbrowdy_examples_zip.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
echo Removing examples folder...
rmdir /s /q crossbrowdy.com\files\examples
echo.
echo Copying necessary files...
xcopy /e /h dist\CrossBrowdy\*.* crossbrowdy.com\files\examples\CrossBrowdy\
copy dist\test.html crossbrowdy.com\files\examples\
xcopy /e /h crossbrowdy.com\_html\_doc\examples\*.* crossbrowdy.com\files\examples\_html\_doc\examples\
echo.
echo Deleting PHP files...
del /s /q crossbrowdy.com\files\examples\_html\*.php
echo.
echo Removing empty folders...
ROBOCOPY crossbrowdy.com\files\examples\ crossbrowdy.com\files\examples\ /s /move /njh /njs
echo.
echo Copying LICENSE file...
copy LICENSE crossbrowdy.com\files\examples\
echo.
echo Generating index.html from the template...
call php _scripts/create_examples_index.php >crossbrowdy.com\files\examples\index.html
REM Compresses all generating a ZIP file (source: cam029 @ https://superuser.com/a/1151380):
echo.
echo Compressing all and generating ZIP file...
del /s /q crossbrowdy.com\files\CrossBrowdy_examples.zip
setlocal
set sourceDir=crossbrowdy.com\files\examples\
set zipFile=crossbrowdy.com\files\CrossBrowdy_examples.zip
REM Create PowerShell script:
echo Write-Output 'Custom PowerShell profile in effect!' > %~dp0TempZipScript.ps1
echo Add-Type -A System.IO.Compression.FileSystem >> %~dp0TempZipScript.ps1
echo [IO.Compression.ZipFile]::CreateFromDirectory('%sourceDir%','%~dp0%zipFile%') >> %~dp0TempZipScript.ps1
REM Execute script with flag "-ExecutionPolicy Bypass" to get around ExecutionPolicy:
PowerShell.exe -ExecutionPolicy Bypass -Command "& '%~dp0TempZipScript.ps1'"
del %~dp0TempZipScript.ps1
endlocal
echo.
echo Deleting examples folder...
rmdir /s /q crossbrowdy.com\files\examples
pause