]> BookStack Code Mirror - system-cli/commitdiff
Added warning to complile when dev deps are installed
authorDan Brown <redacted>
Sat, 29 Apr 2023 13:13:20 +0000 (14:13 +0100)
committerDan Brown <redacted>
Sat, 29 Apr 2023 13:13:20 +0000 (14:13 +0100)
compile.php

index 9c51d1626d1687033982506e2a90158d90b3b822..9d137d5ea81e9a92ad486fcdb40ba48e49ac7a3e 100644 (file)
@@ -18,6 +18,10 @@ try {
         unlink($pharFile . '.gz');
     }
 
+    if (is_dir(__DIR__ . '/vendor/phpunit')) {
+        throw new Exception("You should only compile when dev dependencies are NOT installed");
+    }
+
     // create phar
     $phar = new Phar($pharFile);
 
@@ -44,9 +48,9 @@ try {
     $phar->compressFiles(Phar::GZ);
 
     # Make the file executable
-    chmod(__DIR__ . "/{$pharFile}", 0770);
+    chmod(__DIR__ . "/{$pharFile}", 0775);
 
     echo "$pharFile successfully created" . PHP_EOL;
 } catch (Exception $e) {
-    echo $e->getMessage();
+    echo "ERROR: " . $e->getMessage() . "\n";
 }