From bd037bdca480daf202ed3962ded853ec20aa8eb1 Mon Sep 17 00:00:00 2001 From: naoey Date: Fri, 13 Aug 2021 21:28:28 +0530 Subject: [PATCH] Invoke fnm use on startup for PowerShell (#514) --- src/shell/powershell.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shell/powershell.rs b/src/shell/powershell.rs index e451112..dfe44cb 100644 --- a/src/shell/powershell.rs +++ b/src/shell/powershell.rs @@ -19,10 +19,12 @@ impl Shell for PowerShell { fn use_on_cd(&self, _config: &crate::config::FnmConfig) -> String { indoc!(r#" - function Set-LocationWithFnm { param($path); Set-Location $path; If ((Test-Path .nvmrc) -Or (Test-Path .node-version)) { & fnm use } } + function Set-FnmOnLoad { If ((Test-Path .nvmrc) -Or (Test-Path .node-version)) { & fnm use } } + function Set-LocationWithFnm { param($path); Set-Location $path; Set-FnmOnLoad } Set-Alias cd_with_fnm Set-LocationWithFnm -Force Remove-Item alias:\cd New-Alias cd Set-LocationWithFnm + Set-FnmOnLoad "#).into() } fn into_structopt_shell(&self) -> clap::Shell {