- Added aria-label and type attributes to the edit button in the sidebar. - Implemented a mechanism to prevent multiple edit triggers using requestAnimationFrame. - Updated mousedown event handling to allow real controls while preventing text selection in WKWebView. feat: add reconnectSession method to TabManager - Introduced reconnectSession method to facilitate session reconnections by ID. feat: implement disconnected overlay in terminal - Added setDisconnectedOverlay method to show/hide a disconnected overlay for terminal sessions. - Created _ensureDisconnectOverlay method to manage the overlay's existence and content. feat: extend Service API with file-related functions - Added FileExists and FileIsPrivateKey functions to check file existence and identify private keys. - Introduced ListSSHKeys function to retrieve SSH private key paths from the user's .ssh directory. - Implemented SFTPStat and SFTPUploadData functions for enhanced SFTP operations. refactor: clean up code formatting and improve readability - Adjusted code formatting for better readability across various files, including consistent use of line breaks and indentation.
97 lines
2.9 KiB
PowerShell
97 lines
2.9 KiB
PowerShell
# build.ps1 — Windows build script for Nexus Terminal
|
|
# Usage: .\build.ps1 [dev|build|test|clean|deps]
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
function Write-Info($Message) { Write-Host "[nexus] $Message" -ForegroundColor Green }
|
|
function Write-Warn($Message) { Write-Host "[nexus] $Message" -ForegroundColor Yellow }
|
|
function Write-Err($Message) { Write-Host "[nexus] $Message" -ForegroundColor Red }
|
|
|
|
function Get-WailsPath {
|
|
$wails = Get-Command wails -ErrorAction SilentlyContinue
|
|
if ($wails) { return $wails.Source }
|
|
|
|
$goPath = & go env GOPATH
|
|
$fallback = Join-Path $goPath 'bin\wails.exe'
|
|
if (Test-Path $fallback) { return $fallback }
|
|
return $null
|
|
}
|
|
|
|
function Check-Deps {
|
|
if (-not (Get-Command go -ErrorAction SilentlyContinue)) { throw 'Go is not installed.' }
|
|
if (-not (Get-Command node -ErrorAction SilentlyContinue)) { throw 'Node.js is not installed.' }
|
|
if (-not (Get-Command npm -ErrorAction SilentlyContinue)) { throw 'npm is not installed.' }
|
|
|
|
$wailsPath = Get-WailsPath
|
|
if (-not $wailsPath) {
|
|
throw 'Wails is not installed. Run: go install github.com/wailsapp/wails/v2/cmd/wails@latest'
|
|
}
|
|
|
|
Write-Info "Go: $(& go version)"
|
|
Write-Info "Node: $(& node --version)"
|
|
Write-Info "Wails: $(& $wailsPath version | Select-Object -First 1)"
|
|
|
|
if (-not (Get-Command gcc -ErrorAction SilentlyContinue)) {
|
|
Write-Warn 'gcc not found. SQLite requires cgo + a C compiler (e.g. MSYS2 mingw-w64).'
|
|
}
|
|
|
|
return $wailsPath
|
|
}
|
|
|
|
function Install-Deps {
|
|
Write-Info 'Installing Go dependencies...'
|
|
& go mod download
|
|
|
|
Write-Info 'Installing frontend dependencies...'
|
|
Push-Location 'frontend'
|
|
& npm install
|
|
Pop-Location
|
|
}
|
|
|
|
function Dev {
|
|
$wailsPath = Check-Deps
|
|
Install-Deps
|
|
Write-Info 'Starting development mode...'
|
|
& $wailsPath dev
|
|
}
|
|
|
|
function Build {
|
|
$wailsPath = Check-Deps
|
|
Install-Deps
|
|
|
|
$env:CGO_ENABLED = '1'
|
|
Write-Info 'Building production binary (CGO_ENABLED=1)...'
|
|
& $wailsPath build -ldflags "-s -w"
|
|
Write-Info 'Build complete: build\bin\'
|
|
}
|
|
|
|
function Run-Tests {
|
|
Write-Info 'Running tests...'
|
|
& go test ./... -v -count=1
|
|
}
|
|
|
|
function Clean {
|
|
Write-Info 'Cleaning build artefacts...'
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue build\bin
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue frontend\node_modules
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue frontend\src\js\lib
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue frontend\src\css\lib
|
|
& go clean -testcache
|
|
Write-Info 'Clean complete'
|
|
}
|
|
|
|
$task = $args[0]
|
|
if (-not $task) { $task = 'build' }
|
|
|
|
switch ($task) {
|
|
'dev' { Dev }
|
|
'build' { Build }
|
|
'test' { Run-Tests }
|
|
'clean' { Clean }
|
|
'deps' { Check-Deps | Out-Null; Install-Deps }
|
|
default {
|
|
Write-Err 'Usage: .\\build.ps1 [dev|build|test|clean|deps]'
|
|
exit 1
|
|
}
|
|
}
|