mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
calling it run()
This commit is contained in:
@@ -329,7 +329,7 @@ fn run_update_action(action: UpdateAction) -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
fn run_execpolicy_check(cli: ExecPolicyCheckCommand) -> anyhow::Result<()> {
|
||||
let json = cli.to_json()?;
|
||||
let json = cli.run()?;
|
||||
println!("{json}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ pub struct ExecPolicyCheckCommand {
|
||||
|
||||
impl ExecPolicyCheckCommand {
|
||||
/// Load the policies for this command, evaluate the command, and render JSON output.
|
||||
pub fn to_json(&self) -> Result<String> {
|
||||
pub fn run(&self) -> Result<String> {
|
||||
let policy = load_policies(&self.policies)?;
|
||||
let evaluation = policy.check(&self.command);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ fn main() -> Result<()> {
|
||||
}
|
||||
|
||||
fn cmd_check(cmd: ExecPolicyCheckCommand) -> Result<()> {
|
||||
let json = cmd.to_json()?;
|
||||
let json = cmd.run()?;
|
||||
println!("{json}");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user