-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cmd
More file actions
34 lines (27 loc) · 868 Bytes
/
build.cmd
File metadata and controls
34 lines (27 loc) · 868 Bytes
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
@echo off
:: sets the selected lab as the default landing of localhost
:: to revisit
set /p source=write the laboratory directory:
set "destination=F:\xampp\htdocs\%source%"
if not exist "%source%\" (
echo error: source directory "%source%" does not exist.
exit /b 1
)
echo %source%
echo %destination%
if exist "%destination%" (
rmdir /s /q "%destination%"
)
mkdir "%destination%"
xcopy /E /I /Y "%source%\*" "%destination%"
echo ^<?php> index.php
echo if (!empty($_SERVER['HTTPS']) ^&^& ('on' == $_SERVER['HTTPS'])) {>> index.php
echo $uri = 'https://';>> index.php
echo } else {>> index.php
echo $uri = 'http://';>> index.php
echo }>> index.php
echo $uri .= $_SERVER['HTTP_HOST'];>> index.php
echo header('Location: ' . $uri . '/%source%');>> index.php
echo exit;>> index.php
del "F:\xampp\htdocs\index.php"
move index.php "F:\xampp\htdocs\"