mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 14:41:29 +00:00
feat(Terminal):对交互式命令进行提示并终止执行
This commit is contained in:
parent
1310d6d106
commit
631fccd9e6
@ -220,6 +220,7 @@ class Terminal
|
||||
if (preg_match('/\r\n|\r|\n/', $newOutput)) {
|
||||
$this->output($newOutput);
|
||||
$this->outputContent = $contents;
|
||||
$this->checkOutput();
|
||||
}
|
||||
}
|
||||
|
||||
@ -287,6 +288,17 @@ class Terminal
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查输出
|
||||
*/
|
||||
public function checkOutput(): void
|
||||
{
|
||||
if (str_contains($this->outputContent, '(Y/n)')) {
|
||||
$this->execError('An interactive command has been detected, and you can manually execute the command to confirm the situation.', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出状态标记
|
||||
* @param string $flag
|
||||
|
Loading…
Reference in New Issue
Block a user