feat: create standalone native fnOS repository
This commit is contained in:
@@ -4,9 +4,8 @@ param(
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
$project = Join-Path $PSScriptRoot "havline"
|
||||
$mainRepo = Join-Path $root "havline"
|
||||
$mainRepo = Join-Path $PSScriptRoot "app-src"
|
||||
$version = (Get-Content -Raw (Join-Path $mainRepo "VERSION")).Trim()
|
||||
|
||||
function Copy-Tree {
|
||||
@@ -27,12 +26,18 @@ if (-not (Test-Path -LiteralPath $project)) {
|
||||
}
|
||||
|
||||
if (-not $FnpackPath) {
|
||||
$localTool = Join-Path $root "fnos\fnpack.exe"
|
||||
$localTool = Join-Path $PSScriptRoot "fnpack.exe"
|
||||
$FnpackPath = if (Test-Path -LiteralPath $localTool) { $localTool } else { "fnpack" }
|
||||
}
|
||||
|
||||
Push-Location (Join-Path $mainRepo "web")
|
||||
try {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path (Get-Location) "node_modules"))) {
|
||||
npm ci
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "安装前端依赖失败,退出码:$LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
$env:VITE_BASE_PATH = "/app/havline/"
|
||||
npm run build
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
|
||||
Reference in New Issue
Block a user