microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
478bf6796d8659fbd99e3413c061b39aff4ccf88

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

flowey/flowey_cli/src/lib.rs

36lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#![expect(missing_docs)]
5#![forbid(unsafe_code)]
6
7use flowey_core::pipeline::IntoPipeline;
8use std::path::Path;
9
10mod cli;
11mod flow_resolver;
12mod pipeline_resolver;
13mod var_db;
14
15/// Entrypoint into generic flowey infrastructure.
16pub fn flowey_main<ProjectPipelines: clap::Subcommand + IntoPipeline>(
17 flowey_crate: &str,
18 repo_root: &Path,
19) -> ! {
20 if let Err(e) = cli::cli_main::<ProjectPipelines>(flowey_crate, repo_root) {
21 log::error!("Error: {:#}", e);
22 std::process::exit(-1);
23 } else {
24 std::process::exit(0)
25 }
26}
27
28fn running_in_wsl() -> bool {
29 let Ok(output) = std::process::Command::new("wslpath")
30 .args(["-aw", "/"])
31 .output()
32 else {
33 return false;
34 };
35 String::from_utf8_lossy(&output.stdout).starts_with(r"\\wsl.localhost")
36}
37