diff --git a/build b/build index f03d5633..ed0be8b7 100755 --- a/build +++ b/build @@ -8,6 +8,9 @@ '; $page_src .= load_page($release_conf); -file_put_contents($output."index.php", $page_src); +file_put_contents(OUTPUT_DIRECTORY."index.php", $page_src); // Add .htaccess file $htaccess = ' @@ -210,9 +216,38 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [L] '; -file_put_contents($output.".htaccess", $htaccess); +file_put_contents(OUTPUT_DIRECTORY.".htaccess", $htaccess); //Done notice("Done.", TRUE); +} //BUILD + +/** + * Clean build directory + */ +function clean(){ + notice("Cleaning build directory.", TRUE); + delDir(OUTPUT_DIRECTORY); +} + +//Get the action and do it +if(!isset($_SERVER['argv'][1])) + exit("Usage: ./build [action]"); +$action = $_SERVER['argv'][1]; + +switch($action){ + + case "build": + build(); + break; + + case "clean": + clean(); + break; + + default: + notice("Accepted commands are build, clean.", TRUE); + +} \ No newline at end of file