From 328a507a9f4e612225d99a08b10461300edffd57 Mon Sep 17 00:00:00 2001 From: luxick Date: Fri, 20 Feb 2026 18:01:20 +0100 Subject: [PATCH] Update windows deploy script --- deploy.ps1 | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/deploy.ps1 b/deploy.ps1 index 28e3ed3..ce064ce 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -7,10 +7,40 @@ # .\deploy.ps1 C:\path\to\luxtools # .\deploy.ps1 --no-delete # don't delete extraneous files at target -$TARGET = "S:\Web\lib\plugins\luxtools" +$TARGET = "S:\7-Infrastructure\lib\plugins\luxtools" $DRY_RUN = $false $DELETE = $true +function Resolve-PathUsingExistingCase { + param( + [Parameter(Mandatory = $true)] + [string]$Path + ) + + $fullPath = [System.IO.Path]::GetFullPath($Path) + $root = [System.IO.Path]::GetPathRoot($fullPath).TrimEnd('\\') + + if ($fullPath.TrimEnd('\\') -ieq $root) { + return $root + } + + $parent = Split-Path -Path $fullPath -Parent + $leaf = Split-Path -Path $fullPath -Leaf + $resolvedParent = Resolve-PathUsingExistingCase -Path $parent + + if (Test-Path -LiteralPath $resolvedParent) { + $match = Get-ChildItem -LiteralPath $resolvedParent -Force -ErrorAction SilentlyContinue | + Where-Object { $_.Name -ieq $leaf } | + Select-Object -First 1 + + if ($null -ne $match) { + return (Join-Path -Path $resolvedParent -ChildPath $match.Name) + } + } + + return (Join-Path -Path $resolvedParent -ChildPath $leaf) +} + foreach ($arg in $args) { if ($arg -eq "--dry-run" -or $arg -eq "-n") { $DRY_RUN = $true @@ -30,6 +60,8 @@ foreach ($arg in $args) { $TARGET = $arg } +$TARGET = Resolve-PathUsingExistingCase -Path $TARGET + $SRC_DIR = $PSScriptRoot # Safety checks: make sure source looks like luxtools plugin