Add embed sanity check

This commit is contained in:
crazywhalecc
2024-12-10 23:08:01 +08:00
committed by Jerry Ma
parent f433866671
commit c4b9660cd7
6 changed files with 61 additions and 1 deletions

View File

@@ -62,6 +62,9 @@ class UnixShell
logger()->debug(ConsoleColor::blue('[EXEC] ') . ConsoleColor::gray($cmd));
}
logger()->debug('Executed at: ' . debug_backtrace()[0]['file'] . ':' . debug_backtrace()[0]['line']);
if ($this->cd !== null) {
$cmd = 'cd ' . escapeshellarg($this->cd) . ' && ' . $cmd;
}
exec($cmd, $out, $code);
return [$code, $out];
}