- Introduced a new PowerShell script `build-unlock-rescue.ps1` to facilitate the unlocking process for NyaTerm. - Added a corresponding build command `build:unlock-rescue` in package.json to streamline the execution of the unlock rescue script. - Implemented functionality in the script to create a backup of the database and disable screen lock settings.
19 lines
764 B
PowerShell
19 lines
764 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
$repoRoot = Split-Path -Parent $PSScriptRoot
|
|
$manifestPath = Join-Path $repoRoot "src-tauri/Cargo.toml"
|
|
$artifactDir = Join-Path $repoRoot "dist/rescue"
|
|
$sourceExe = Join-Path $repoRoot "src-tauri/target/release/nyaterm-unlock-rescue.exe"
|
|
$targetExe = Join-Path $artifactDir "nyaterm-unlock-rescue.exe"
|
|
$targetZip = Join-Path $artifactDir "nyaterm-unlock-rescue-windows-x64.zip"
|
|
|
|
cargo build --release --manifest-path $manifestPath --bin nyaterm-unlock-rescue
|
|
|
|
New-Item -ItemType Directory -Force -Path $artifactDir | Out-Null
|
|
Copy-Item -Force -Path $sourceExe -Destination $targetExe
|
|
Compress-Archive -Force -Path $targetExe -DestinationPath $targetZip
|
|
|
|
Write-Host "Built rescue tool:"
|
|
Write-Host $targetExe
|
|
Write-Host $targetZip
|