From a41f8bede380dfab3da958d4200535f8773e0e41 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Thu, 6 Oct 2016 16:37:35 +0100 Subject: [PATCH] Updated the build script to produce a ZIP archive from the git working tree --- resources/build/build.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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