Initial commit of version 0.2.0
This commit is contained in:
parent
86fc06b877
commit
dfb04462f3
108 changed files with 16167 additions and 80 deletions
31
scripts/Set-Version.ps1
Normal file
31
scripts/Set-Version.ps1
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#requires -Version 5.1
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidatePattern('^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$')]
|
||||
[string]$Version
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$repositoryRoot = Split-Path -Parent $PSScriptRoot
|
||||
$appRoot = Join-Path $repositoryRoot 'app'
|
||||
|
||||
Push-Location $appRoot
|
||||
try {
|
||||
& npm.cmd version $Version --no-git-tag-version --allow-same-version
|
||||
if ($LASTEXITCODE) { throw 'npm could not update package.json and package-lock.json.' }
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
$tauriConfigPath = Join-Path $appRoot 'src-tauri\tauri.conf.json'
|
||||
$tauriConfig = Get-Content -Raw -LiteralPath $tauriConfigPath
|
||||
$tauriConfig = [regex]::Replace($tauriConfig, '(?m)(^\s*"version"\s*:\s*")[^"]+("\s*,)', "`${1}$Version`${2}", 1)
|
||||
[IO.File]::WriteAllText($tauriConfigPath, $tauriConfig, (New-Object Text.UTF8Encoding($false)))
|
||||
|
||||
$cargoManifestPath = Join-Path $appRoot 'src-tauri\Cargo.toml'
|
||||
$cargoManifest = Get-Content -Raw -LiteralPath $cargoManifestPath
|
||||
$cargoManifest = [regex]::Replace($cargoManifest, '(?m)(^version\s*=\s*")[^"]+("\s*$)', "`${1}$Version`${2}", 1)
|
||||
[IO.File]::WriteAllText($cargoManifestPath, $cargoManifest, (New-Object Text.UTF8Encoding($false)))
|
||||
|
||||
Write-Host "Decky version set to $Version in npm, Tauri, and Cargo manifests."
|
||||
Loading…
Add table
Add a link
Reference in a new issue