-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.cmd
More file actions
30 lines (24 loc) · 716 Bytes
/
build.cmd
File metadata and controls
30 lines (24 loc) · 716 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
@echo off
set "partition=C:"
if not "%~1"=="" (
set "partition=%~1"
)
set "name=TidyTogether"
set "source=..\%name%"
set "destination=%partition%\xampp\htdocs\%name%"
if exist "%destination%" (
rmdir /s /q "%destination%"
)
mkdir "%destination%"
xcopy /E /I /Y "%source%\*" "%destination%"
echo ^<?php> p.php
echo if (!empty($_SERVER['HTTPS']) ^&^& ('on' == $_SERVER['HTTPS'])) {>> p.php
echo $uri = 'https://';>> p.php
echo } else {>> p.php
echo $uri = 'http://';>> p.php
echo }>> p.php
echo $uri .= $_SERVER['HTTP_HOST'];>> p.php
echo header('Location: ' . $uri . '/%name%');>> p.php
echo exit;>> p.php
del "%partition%\xampp\htdocs\index.php"
move p.php "%partition%\xampp\htdocs\index.php"