mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 13:24:46 +00:00
remove #! from beginning of loaded files to support use in shell scripts
This commit is contained in:
parent
2b8be79c0e
commit
7e146d8a9d
@ -322,6 +322,11 @@ class Evaller
|
||||
|
||||
$input = @file_get_contents($targetFile);
|
||||
|
||||
// Remove #! from the beginning that is used by shell scripts
|
||||
if (extension_loaded('pcre')) {
|
||||
$input = preg_replace('/^#![^\n\r]*[\n\r]+/', '', $input, 1);
|
||||
}
|
||||
|
||||
// Wrap input in a do to process multiple expressions
|
||||
$input = "(do $input)";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user