Browse Source

Invoke fnm use on startup for PowerShell (#514)

remotes/origin/add-with-shims
naoey 4 years ago committed by GitHub
parent
commit
bd037bdca4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/shell/powershell.rs

4
src/shell/powershell.rs

@ -19,10 +19,12 @@ impl Shell for PowerShell {
fn use_on_cd(&self, _config: &crate::config::FnmConfig) -> String { fn use_on_cd(&self, _config: &crate::config::FnmConfig) -> String {
indoc!(r#" 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 Set-Alias cd_with_fnm Set-LocationWithFnm -Force
Remove-Item alias:\cd Remove-Item alias:\cd
New-Alias cd Set-LocationWithFnm New-Alias cd Set-LocationWithFnm
Set-FnmOnLoad
"#).into() "#).into()
} }
fn into_structopt_shell(&self) -> clap::Shell { fn into_structopt_shell(&self) -> clap::Shell {

Loading…
Cancel
Save