summaryrefslogtreecommitdiff
path: root/cli/ops/mod.rs
blob: 98029ab44f32e100499b643b12ee2965dcb4ffdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.

use crate::proc_state::ProcState;
use deno_core::Extension;

pub mod bench;
pub mod testing;

pub fn cli_exts(ps: ProcState) -> Vec<Extension> {
  vec![init_proc_state(ps)]
}

fn init_proc_state(ps: ProcState) -> Extension {
  Extension::builder()
    .state(move |state| {
      state.put(ps.clone());
      Ok(())
    })
    .build()
}