Updated the build script to produce a ZIP archive from the git working tree

This commit is contained in:
Andy Heathershaw 2016-10-06 16:37:35 +01:00
parent d0803b37d9
commit a41f8bede3

View File

@ -8,6 +8,12 @@ echo 'Blue Twilight Packaging Script' . PHP_EOL;
echo '(c) Andy Heathershaw 2016' . PHP_EOL;
echo '------------------------------' . PHP_EOL . PHP_EOL;
if ($argc != 3)
{
echo sprintf('Usage: %s [version_number] [output_directory]', $argv[0]) . PHP_EOL . PHP_EOL;
exit(1);
}
echo 'Checking current folder...' . PHP_EOL . PHP_EOL;
$appRoot = dirname(dirname(__DIR__));
@ -66,8 +72,15 @@ $sgCommand = sprintf(
PROJECT_KEY
);
system($sgCommand);
echo 'Creating the release archive...' . PHP_EOL . PHP_EOL;
system('git stash');
system(sprintf('git archive --format zip --output %1$s/blue-twilight_%2$s.zip --prefix=blue-twilight_%2$s/ "stash@{0}"', $argv[2], $argv[1]));
system('git stash pop');
echo PHP_EOL . PHP_EOL;
echo 'All done!';
echo PHP_EOL . PHP_EOL;
exit();
?>