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

Function open_url_async

crates/chat-cli/src/util/open.rs:73–91  ·  view source on GitHub ↗

Returns bool indicating whether the URL was opened successfully

(url: impl AsRef<str>)

Source from the content-addressed store, hash-verified

71
72/// Returns bool indicating whether the URL was opened successfully
73pub async fn open_url_async(url: impl AsRef<str>) -> Result<(), Error> {
74 cfg_if! {
75 if #[cfg(target_os = "macos")] {
76 open_macos(url)
77 } else {
78 match tokio::process::Command::from(open_command(url)).output().await {
79 Ok(output) => {
80 tracing::trace!(?output, "open_url_async output");
81 if output.status.success() {
82 Ok(())
83 } else {
84 Err(Error::Failed)
85 }
86 },
87 Err(err) => Err(err.into()),
88 }
89 }
90 }
91}
92
93#[cfg(test)]
94mod tests {

Callers 6

test_pkce_flow_e2eFunction · 0.85
executeMethod · 0.85
try_device_authorizationFunction · 0.85
executeMethod · 0.85
upgrade_to_proFunction · 0.85
create_urlMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_pkce_flow_e2eFunction · 0.68