create save to directory if it doesn't exist

This commit is contained in:
David Refoua 2022-10-14 23:16:54 +03:30 committed by GitHub
parent 2189fe9483
commit 28e42104ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<# <#
.Synopsis .Synopsis
Pack cmder Pack Cmder
.DESCRIPTION .DESCRIPTION
Use this script to pack cmder into release archives Use this script to pack cmder into release archives
@ -36,7 +36,6 @@ Param(
) )
$cmderRoot = Resolve-Path $cmderRoot $cmderRoot = Resolve-Path $cmderRoot
$saveTo = Resolve-Path $saveTo
. "$PSScriptRoot\utils.ps1" . "$PSScriptRoot\utils.ps1"
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@ -51,6 +50,12 @@ $targets = @{
Delete-Existing "..\Version*" Delete-Existing "..\Version*"
Delete-Existing "..\build\*" Delete-Existing "..\build\*"
If(-not (Test-Path -PathType container $saveTo)) {
New-Item -ItemType Directory -Path $saveTo
}
$saveTo = Resolve-Path $saveTo
$version = Get-VersionStr $version = Get-VersionStr
(New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null (New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null