增加 sudo 命令判断

This commit is contained in:
whyour committed 2026-06-13 00:53:41 +08:00
1 parent 7d8feadc78
commit 96b4c90398
10 files changed
+62 -24

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
export function isInContainer(): boolean {
return process.env.QL_CONTAINER === 'true';
}
export function maybeSudo(cmd: string): string {
return isInContainer() ? `sudo ${cmd}` : cmd;
}