Adds a check to create the profile file if it doesn't exist

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
This commit is contained in:
alexis-opolka 2025-02-28 01:02:32 +01:00
parent 2bb57a23b8
commit 6f82c186a7

View file

@ -32,6 +32,12 @@ function InstallNaviWidgetModule(){
exit 1
}
### We first need to be sure the profile has been created
if (-Not(Test-Path -Path $PROFILE)) {
### The Profile file hasn't been created yet
New-Item -ItemType "file" -Path $PROFILE -Force
}
Write-Debug "Registering the navi shortcut inside the current shell session"
Set-PSReadlineKeyHandler -BriefDescription "A keybinding to open Navi Widget" -Chord Ctrl+g -ScriptBlock { Invoke-NaviWidget }