Misc fixes
* Updated build scripts to handle gitless environments a little better * PDO shell plugin improvements * More tests
This commit is contained in:
@ -10,6 +10,13 @@ class ScriptRunner
|
||||
|
||||
private ?string $directory = null;
|
||||
|
||||
private bool $quiet;
|
||||
|
||||
public function __construct(bool $quiet=false)
|
||||
{
|
||||
$this->quiet = $quiet;
|
||||
}
|
||||
|
||||
public function setDirectory(?string $directory)
|
||||
{
|
||||
$this->directory = $directory;
|
||||
@ -22,6 +29,10 @@ class ScriptRunner
|
||||
|
||||
public function evaluateDefinedScript(string $name)
|
||||
{
|
||||
if (!array_key_exists($name, $this->scripts)) {
|
||||
printf("error: The script {$name} is not defined\n");
|
||||
exit(1);
|
||||
}
|
||||
$script = $this->scripts[$name];
|
||||
$this->evaluate($script);
|
||||
}
|
||||
@ -44,10 +55,12 @@ class ScriptRunner
|
||||
$subscript = $this->scripts[$subname];
|
||||
$this->evaluate($subscript);
|
||||
} else {
|
||||
if (posix_isatty(STDOUT)) {
|
||||
printf("\e[0;33m> \e[0;93m%s\e[0m\n", $script);
|
||||
} else {
|
||||
printf("> %s\n", $script);
|
||||
if (!$this->quiet) {
|
||||
if (posix_isatty(STDOUT)) {
|
||||
printf("\e[0;33m> \e[0;93m%s\e[0m\n", $script);
|
||||
} else {
|
||||
printf("> %s\n", $script);
|
||||
}
|
||||
}
|
||||
|
||||
if (str_contains($script, ' ')) {
|
||||
|
Reference in New Issue
Block a user