MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / is_process_running

Method is_process_running

crates/chat-cli/src/os/sysinfo.rs:39–49  ·  view source on GitHub ↗

Returns whether the process containing `name` is running.

(&self, name: &str)

Source from the content-addressed store, hash-verified

37
38 /// Returns whether the process containing `name` is running.
39 pub fn is_process_running(&self, name: &str) -> bool {
40 use inner::Inner;
41 match &self.0 {
42 Inner::Real => {
43 let system = sysinfo::System::new_all();
44
45 system.processes_by_name(&OsString::from(name)).next().is_some()
46 },
47 Inner::Fake(fake) => fake.lock().unwrap().process_names.contains(name),
48 }
49 }
50
51 pub fn add_running_processes(&self, process_names: &[&str]) {
52 use inner::Inner;

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected