mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-22 02:00:40 +00:00
Improving build.php
This commit is contained in:
parent
bae9cabc1e
commit
91456cafe1
73
build.php
73
build.php
@ -1,16 +1,61 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
@unlink('file.tar');
|
echo <<<EOT
|
||||||
@unlink('template.tar');
|
Cleaning up
|
||||||
@unlink('timwolla.wcf.chat.tar');
|
-----------
|
||||||
exec('coffee -cb file/js/*.coffee');
|
|
||||||
chdir('file');
|
EOT;
|
||||||
exec('tar cvf ../file.tar * --exclude=*.coffee');
|
if (file_exists('file.tar')) unlink('file.tar');
|
||||||
chdir('..');
|
if (file_exists('template.tar')) unlink('template.tar');
|
||||||
chdir('template');
|
foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile);
|
||||||
exec('tar cvf ../template.tar *');
|
foreach (glob('file/style/*.css') as $cssFile) unlink($cssFile);
|
||||||
chdir('..');
|
if (file_exists('timwolla.wcf.chat.tar')) unlink('timwolla.wcf.chat.tar');
|
||||||
exec('tar cvf timwolla.wcf.chat.tar * --exclude=file --exclude=template --exclude=build.php');
|
echo <<<EOT
|
||||||
@unlink('file.tar');
|
|
||||||
@unlink('template.tar');
|
Building JavaScript
|
||||||
exec('rm file/js/*.js');
|
-------------------
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
foreach (glob('file/js/*.coffee') as $coffeeFile) {
|
||||||
|
echo $coffeeFile."\n";
|
||||||
|
passthru('coffee -cb '.escapeshellarg($coffeeFile));
|
||||||
|
}
|
||||||
|
echo <<<EOT
|
||||||
|
|
||||||
|
Building CSS
|
||||||
|
------------
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
foreach (glob('file/style/*.scss') as $sassFile) {
|
||||||
|
echo $sassFile."\n";
|
||||||
|
passthru('scss '.escapeshellarg($sassFile).' '.escapeshellarg(substr($sassFile, 0, -4).'css'));
|
||||||
|
}
|
||||||
|
echo <<<EOT
|
||||||
|
|
||||||
|
Building file.tar
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
chdir('file');
|
||||||
|
passthru('tar cvf ../file.tar * --exclude=*.coffee');
|
||||||
|
echo <<<EOT
|
||||||
|
|
||||||
|
Building template.tar
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
chdir('../template');
|
||||||
|
passthru('tar cvf ../template.tar *');
|
||||||
|
echo <<<EOT
|
||||||
|
|
||||||
|
Building timwolla.wcf.chat.tar
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
EOT;
|
||||||
|
chdir('..');
|
||||||
|
passthru('tar cvf timwolla.wcf.chat.tar * --exclude=file --exclude=template --exclude=build.php');
|
||||||
|
|
||||||
|
if (file_exists('file.tar')) unlink('file.tar');
|
||||||
|
if (file_exists('template.tar')) unlink('template.tar');
|
||||||
|
foreach (glob('file/js/*.js') as $jsFile) unlink($jsFile);
|
||||||
|
foreach (glob('file/style/*.css') as $cssFile) unlink($cssFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user