fix(pi-workflow): suppress verification bytecode
This commit is contained in:
@@ -23,8 +23,17 @@ export interface CommandResult {
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
export interface CommandRunOptions {
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}
|
||||
|
||||
export interface CommandRunner {
|
||||
run(cwd: string, executable: string, args: string[]): Promise<CommandResult>;
|
||||
run(
|
||||
cwd: string,
|
||||
executable: string,
|
||||
args: string[],
|
||||
options?: CommandRunOptions,
|
||||
): Promise<CommandResult>;
|
||||
}
|
||||
|
||||
export class WorkspaceSafetyError extends Error {
|
||||
@@ -546,6 +555,12 @@ export class ApprovedHostCommandExecutor {
|
||||
root,
|
||||
options.executable,
|
||||
[...options.args],
|
||||
{
|
||||
env: {
|
||||
...process.env,
|
||||
PYTHONDONTWRITEBYTECODE: "1",
|
||||
},
|
||||
},
|
||||
);
|
||||
try {
|
||||
const afterRepository = await this.probe.captureRepository(root);
|
||||
@@ -790,12 +805,18 @@ export class WorkspaceValidationError extends Error {
|
||||
}
|
||||
|
||||
export class ExecFileCommandRunner implements CommandRunner {
|
||||
async run(cwd: string, executable: string, args: string[]) {
|
||||
async run(
|
||||
cwd: string,
|
||||
executable: string,
|
||||
args: string[],
|
||||
options: CommandRunOptions = {},
|
||||
) {
|
||||
try {
|
||||
const result = await execFileAsync(executable, args, {
|
||||
cwd,
|
||||
encoding: "utf8",
|
||||
maxBuffer: 4 * 1024 * 1024,
|
||||
env: options.env,
|
||||
});
|
||||
return { code: 0, stdout: result.stdout, stderr: result.stderr };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user