Files
vscode/cli/src/commands/internal_wsl.rs
Connor Peet 1b5fd140fb Run tunnels as singleton process (for a --cli-data-dir) (#177002)
* wip on singleton

* wip

* windows support

* wip

* wip

* fix clippy
2023-03-14 08:09:47 -07:00

33 lines
855 B
Rust

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
use crate::{
tunnels::{serve_wsl, shutdown_signal::ShutdownRequest},
util::{errors::AnyError, prereqs::PreReqChecker},
};
use super::CommandContext;
pub async fn serve(ctx: CommandContext) -> Result<i32, AnyError> {
let signal = ShutdownRequest::create_rx([ShutdownRequest::CtrlC]);
let platform = spanf!(
ctx.log,
ctx.log.span("prereq"),
PreReqChecker::new().verify()
)?;
serve_wsl(
ctx.log,
ctx.paths,
(&ctx.args).into(),
platform,
ctx.http,
signal,
)
.await?;
Ok(0)
}