From c852ce40eb5e5c612ea9613833752a226781d3e9 Mon Sep 17 00:00:00 2001 From: Daniel Kucinski Date: Mon, 14 Sep 2026 17:59:46 +0100 Subject: [PATCH] chore: sync Scout skills 2026-09-14 --- sync-skills.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sync-skills.ps1 b/sync-skills.ps1 index de6e170..8df0fa3 100644 --- a/sync-skills.ps1 +++ b/sync-skills.ps1 @@ -1,11 +1,17 @@ [CmdletBinding()] param( [string] $SourceRoot = 'C:\Users\dkucinski\.scout\m-skills', - [string] $RepositoryRoot = $PSScriptRoot + [string] $RepositoryRoot ) $ErrorActionPreference = 'Stop' +# $PSScriptRoot is empty when the script is launched as `powershell -File ` +# (Windows PowerShell 5.1), which would make the Resolve-Path below fail on an empty string. +if ([string]::IsNullOrWhiteSpace($RepositoryRoot)) { + $RepositoryRoot = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Path } +} + $repositoryRoot = (Resolve-Path -LiteralPath $RepositoryRoot).Path $sourceRoot = (Resolve-Path -LiteralPath $SourceRoot).Path $logDirectory = Join-Path $repositoryRoot 'logs'