microsoft/openvmm

Public

mirrored from https://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
15e07a8246fa7bad80ef06f167641da58f4e021b

Branches

Tags

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

Clone

HTTPS

Download ZIP

flowey/flowey_cli/src/lib.rs

32lines · modecode

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