From 8bb4df9f40f2760414d8dd03a973b7674a767317 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 29 Apr 2018 21:09:22 +0200 Subject: [PATCH] Build system can build different configurations --- build | 7 +++++-- system/config/{build.config.php => offline.config.php} | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) rename system/config/{build.config.php => offline.config.php} (95%) diff --git a/build b/build index 8a0ba181..26b73d16 100755 --- a/build +++ b/build @@ -97,11 +97,14 @@ function rcopy(string $src, string $dst) { //Initialize page require_once __DIR__."/system/system.php"; +//Get the build configuration +if(!isset($_SERVER['argv'][1])) + exit("Usage: ./build [configuration]"); //Defines some variables $output = __DIR__."/output/"; $debug_conf = "dev"; -$release_conf = "build"; +$release_conf = $_SERVER['argv'][1]; @@ -187,7 +190,7 @@ if(isset($_SERVER["REDIRECT_URL"])){ exit(); } } ?>'; -$page_src .= load_page("build"); +$page_src .= load_page($release_conf); file_put_contents($output."index.php", $page_src); // Add .htaccess file diff --git a/system/config/build.config.php b/system/config/offline.config.php similarity index 95% rename from system/config/build.config.php rename to system/config/offline.config.php index 41ddf1cd..eddbeec8 100644 --- a/system/config/build.config.php +++ b/system/config/offline.config.php @@ -1,11 +1,11 @@