diff --git a/resources/build/build.php b/resources/build/build.php index 4a14053..030cb26 100644 --- a/resources/build/build.php +++ b/resources/build/build.php @@ -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(); ?> \ No newline at end of file