|
|
@ -34,7 +34,11 @@ fn set_windows_creation_flags(cmd: &mut Command) {
|
|
|
|
fn platform_build_nvim_cmd(bin: &str) -> Option<Command> {
|
|
|
|
fn platform_build_nvim_cmd(bin: &str) -> Option<Command> {
|
|
|
|
if env::args().any(|arg| arg == "--wsl") {
|
|
|
|
if env::args().any(|arg| arg == "--wsl") {
|
|
|
|
let mut cmd = Command::new("wsl");
|
|
|
|
let mut cmd = Command::new("wsl");
|
|
|
|
cmd.arg(bin);
|
|
|
|
cmd.args(&[
|
|
|
|
|
|
|
|
bin.trim(),
|
|
|
|
|
|
|
|
"-c",
|
|
|
|
|
|
|
|
"let \\$PATH=system(\"bash -ic 'echo \\$PATH' 2>/dev/null\")",
|
|
|
|
|
|
|
|
]);
|
|
|
|
Some(cmd)
|
|
|
|
Some(cmd)
|
|
|
|
} else if Path::new(&bin).exists() {
|
|
|
|
} else if Path::new(&bin).exists() {
|
|
|
|
Some(Command::new(bin))
|
|
|
|
Some(Command::new(bin))
|
|
|
@ -63,14 +67,17 @@ fn build_nvim_cmd() -> Command {
|
|
|
|
#[cfg(windows)]
|
|
|
|
#[cfg(windows)]
|
|
|
|
if env::args().any(|arg| arg == "--wsl") {
|
|
|
|
if env::args().any(|arg| arg == "--wsl") {
|
|
|
|
if let Ok(output) = std::process::Command::new("wsl")
|
|
|
|
if let Ok(output) = std::process::Command::new("wsl")
|
|
|
|
.arg("which")
|
|
|
|
.args(&["bash", "-ic", "which nvim"])
|
|
|
|
.arg("nvim")
|
|
|
|
|
|
|
|
.output()
|
|
|
|
.output()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if output.status.success() {
|
|
|
|
if output.status.success() {
|
|
|
|
let path = String::from_utf8(output.stdout).unwrap();
|
|
|
|
let path = String::from_utf8(output.stdout).unwrap();
|
|
|
|
let mut cmd = Command::new("wsl");
|
|
|
|
let mut cmd = Command::new("wsl");
|
|
|
|
cmd.arg(path.trim());
|
|
|
|
cmd.args(&[
|
|
|
|
|
|
|
|
path.trim(),
|
|
|
|
|
|
|
|
"-c",
|
|
|
|
|
|
|
|
"let \\$PATH=system(\"bash -ic 'echo \\$PATH' 2>/dev/null\")",
|
|
|
|
|
|
|
|
]);
|
|
|
|
return cmd;
|
|
|
|
return cmd;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
error!("nvim not found in WSL path");
|
|
|
|
error!("nvim not found in WSL path");
|
|
|
|