Skip to content

Commit

Permalink
Powershell script update
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Nov 19, 2024
1 parent 20106a6 commit 7c4643d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions VSIX/createcmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ param (
[string]$targetdir = "$Env:USERPROFILE\source"
)

$templatedir = "..\" + $templatedir
$reporoot = Split-Path -Path $PSScriptRoot -Parent

$templatedir = Join-Path -Path $reporoot -ChildPath $templatedir

$cmake = $templatedir + "\CMakeLists.txt"

if (-not (Test-Path -Path $cmake)) {
Write-Error -Message "ERROR: $templatedir does not contain a CMake" -ErrorAction Stop
}

$targetdir = $targetdir + "\" + $projectname
$targetdir = Join-Path -Path $targetdir -ChildPath $projectname

if (Test-Path $targetdir) {
Write-Error -Message "ERROR: Project directory already exists" -ErrorAction Stop
Expand Down
6 changes: 4 additions & 2 deletions VSIX/createmsbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ if (-Not ($platformtoolset -match 'v[0-9][0-9][0-9]'))
Write-Error -Message "ERROR: Invalid platform toolset" -ErrorAction Stop
}

$templatedir = "..\" + $templatedir
$reporoot = Split-Path -Path $PSScriptRoot -Parent

$targetdir = $targetdir + "\" + $projectname
$templatedir = Join-Path -Path $reporoot -ChildPath $templatedir

$targetdir = Join-Path -Path $targetdir -ChildPath $projectname

if (Test-Path $targetdir) {
Write-Error -Message "ERROR: Project directory already exists" -ErrorAction Stop
Expand Down

0 comments on commit 7c4643d

Please sign in to comment.