From 14c82f2c03d5e2278c9ee3d4b2506c365fb04749 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 7 Nov 2024 18:26:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20some=20addition?= =?UTF-8?q?al=20logging=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description - Add some additional logging ## Type of change - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- src/functions/private/Initialize-VariableStore.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/functions/private/Initialize-VariableStore.ps1 b/src/functions/private/Initialize-VariableStore.ps1 index 7571ac6..47e1ac3 100644 --- a/src/functions/private/Initialize-VariableStore.ps1 +++ b/src/functions/private/Initialize-VariableStore.ps1 @@ -11,9 +11,12 @@ ) $folderName = ".$($Name -replace '^\.')".ToLower() + Write-Verbose "Variable store folder: [$folderName]" $configFilePath = Join-Path -Path $HOME -ChildPath "$folderName/config.json" - - if (-not (Test-Path -Path $configFilePath)) { + Write-Verbose "Variable store file: [$configFilePath]" + $configFileExists = Test-Path -Path $configFilePath + Write-Verbose "Variable store file exists: [$configFileExists]" + if (-not $configFileExists) { $null = New-Item -Path $configFilePath -ItemType File -Force Set-StoreVariable -Name 'ConfigFilePath' -Value $configFilePath Set-StoreVariable -Name 'Name' -Value $Name