microsoft/openvmm

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1ce32569373cda4d4b485f6e6f09f15e1e4dd569

Branches

Tags

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

Clone

HTTPS

Download ZIP

flowey/flowey_cli/src/lib.rs

35lines · modecode

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