mirror of
https://github.com/denisidoro/navi.git
synced 2026-01-23 02:14:19 +00:00
Tries to implement the call to
Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
This commit is contained in:
parent
7d19bbeb85
commit
4300b7a6d6
1 changed files with 2 additions and 4 deletions
|
|
@ -10,25 +10,23 @@ param (
|
|||
|
||||
|
||||
function InstallNaviWidgetModule(){
|
||||
[String]$PwshModulePath = $env:PSModulePath.Split(";")[0];
|
||||
[String]$NAVI_PLUGIN = "navi.plugin";
|
||||
|
||||
Write-Debug "Are we updating the PowerShell module: $Update"
|
||||
Write-Debug "Current Root Powershell Module path is: $PwshModulePath"
|
||||
|
||||
### If we're updating the module, Copy the newly updated contents to the currently installed module
|
||||
### then quit with a successful exit code.
|
||||
### We're not supposed to update the shortcut binding.
|
||||
if ($Update){
|
||||
Write-Debug "Updating Navi-Widget PowerShell module"
|
||||
Copy-Item -Path .\navi.plugin\ -Destination $PwshModulePath -Force -Recurse
|
||||
Install-Module -Name navi.plugin
|
||||
exit 0
|
||||
}
|
||||
|
||||
### If we're not updating, check if we don't have the module already installed
|
||||
if (-Not (Test-Path -Path $PwshModulePath\$NAVI_PLUGIN)) {
|
||||
Write-Debug "Copying Item to the path"
|
||||
Copy-Item -Path .\navi.plugin\ -Destination $PwshModulePath -Recurse
|
||||
Install-Module -Name navi.plugin
|
||||
} else {
|
||||
Write-Error "Navi-Widget is already installed for PowerShell!"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue