NewProject config workflow integration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user