Skip to content

Commit e83fe9a

Browse files
Guard scripts from being run in non-CLI contexts
1 parent 7a3aa21 commit e83fe9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Resources/bin/yaml-lint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* file that was distributed with this source code.
1111
*/
1212

13+
if ('cli' !== \PHP_SAPI) {
14+
throw new Exception('This script must be run from the command line.');
15+
}
16+
1317
/**
1418
* Runs the Yaml lint command.
1519
*

0 commit comments

Comments
 (0)