add cli checks to Php code
authorAlan <alan@roojs.com>
Wed, 15 Mar 2023 06:51:57 +0000 (14:51 +0800)
committerAlan <alan@roojs.com>
Wed, 15 Mar 2023 06:51:57 +0000 (14:51 +0800)
buildSDK/less-bootstrap-compiler.php
buildSDK/pre-commit
buildSDK/scss-bootstrap.php

index be9fce7..9f48504 100644 (file)
@@ -1,5 +1,9 @@
 <?php
 
+if (php_sapi_name() != 'cli') {
+    die("CLI ONLY");
+}
+
 $cwd = getcwd();
 
 $cc = explode('/', $cwd);
index a47449e..abbaa07 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/php
 <?php
-
+if (php_sapi_name() != 'cli') {
+    die("CLI ONLY");
+}
 // install : ln -s buildSDK/pre-commit .git/hooks/
 
 // the recomendation is to check if the current commit is same as the one on any of the files/directories that need monitoring.
index 9c3858d..022c86c 100644 (file)
@@ -1,5 +1,7 @@
 <?php
-
+if (php_sapi_name() != 'cli') {
+    die("CLI ONLY");
+}
 $cwd = getcwd();
 
 $cc = explode('/', $cwd);