NewProject config workflow integration

This commit is contained in:
Nathan
2026-01-02 16:37:53 -07:00
parent 7a4e9b6662
commit f94600e296
3 changed files with 11780 additions and 17 deletions

View File

@@ -1,3 +1,9 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[string]$ProjectPath
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
@@ -210,7 +216,28 @@ if ($MyInvocation.InvocationName -ne '.') {
# Update config.json to use script's directory as structDir for portability
Update-ConfigStructDir -StructDir $script:LoaderRoot
$projectPath = Get-ProjectPathFromUser
# Use provided ProjectPath parameter, or prompt user if not provided
if ([string]::IsNullOrWhiteSpace($ProjectPath)) {
$projectPath = Get-ProjectPathFromUser
}
else {
# Remove quotes if present and resolve the provided path
$ProjectPath = $ProjectPath.Trim('"', "'")
try {
if (Test-Path -LiteralPath $ProjectPath -PathType Container) {
$projectPath = (Resolve-Path -LiteralPath $ProjectPath -ErrorAction Stop).Path
}
else {
Write-Error "Project path does not exist or is not a directory: $ProjectPath"
exit 1
}
}
catch {
Write-Error "Unable to resolve project directory: $($_.Exception.Message)"
exit 1
}
}
if ($null -ne $projectPath) {
# Deploy batch files and config to the project
$structDir = Get-StructDirectory