microsoft/openvmm

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
58d7ac0c15eef5e011d9b956237ac749dccd14a0

Branches

Tags

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

Clone

HTTPS

Download ZIP

flowey/flowey_cli/src/lib.rs

33lines · modecode

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