diff --git a/crates/turborepo-lib/src/commands/info.rs b/crates/turborepo-lib/src/commands/info.rs index d0e7ccfd9c448..074738dd7ced8 100644 --- a/crates/turborepo-lib/src/commands/info.rs +++ b/crates/turborepo-lib/src/commands/info.rs @@ -1,4 +1,4 @@ -use std::{env, io}; +use std::{env, io, path::Path}; use sysinfo::{System, SystemExt}; use thiserror::Error; @@ -13,6 +13,11 @@ pub enum Error { NoCurrentExe(#[from] io::Error), } +// https://superuser.com/questions/1749781/how-can-i-check-if-the-environment-is-wsl-from-a-shell-script/1749811#1749811 +fn is_wsl() -> bool { + Path::new("/proc/sys/fs/binfmt_misc/WSLInterop").exists() +} + pub async fn run(base: CommandBase) { let system = System::new_all(); let connector = DaemonConnector::new(false, false, &base.repo_root); @@ -44,6 +49,7 @@ pub async fn run(base: CommandBase) { println!("Platform:"); println!(" Architecture: {}", std::env::consts::ARCH); println!(" Operating system: {}", std::env::consts::OS); + println!(" WSL: {}", is_wsl()); println!( " Available memory (MB): {}", system.available_memory() / 1024 / 1024