feat: add support for SVR.JS zip archives with "svrjs.yaml" file
This commit is contained in:
parent
b1d6825e9e
commit
7466fa793f
1 changed files with 10 additions and 1 deletions
|
@ -138,7 +138,16 @@ if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs\svr.compressed" -PathType "Lea
|
||||||
Start-Process -FilePath "$nodejsDir\node.exe" -ArgumentList "$env:SYSTEMDRIVE\svrjs\svrjs\svr.js" -Wait
|
Start-Process -FilePath "$nodejsDir\node.exe" -ArgumentList "$env:SYSTEMDRIVE\svrjs\svrjs\svr.js" -Wait
|
||||||
Pop-Location
|
Pop-Location
|
||||||
}
|
}
|
||||||
Start-Process -FilePath "$nodejsDir\node.exe" -ArgumentList "-e `"var fs=require('fs'),config=JSON.parse(fs.readFileSync('$env:SYSTEMDRIVE\\svrjs\\svrjs\\config.json').toString());config.wwwroot='$env:SYSTEMDRIVE\\svrjs\\wwwroot',fs.writeFileSync('$env:SYSTEMDRIVE\\svrjs\\svrjs\\config.json',JSON.stringify(config,null,2));`"" -Wait
|
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs\svrjs.yaml" -PathType "Leaf") {
|
||||||
|
$svrjsYamlConfig = @"
|
||||||
|
global:
|
||||||
|
wwwroot: `"$env:SYSTEMDRIVE\\svrjs\\wwwroot`"
|
||||||
|
"@
|
||||||
|
|
||||||
|
$svrjsYamlConfig | Out-File -FilePath "$env:SYSTEMDRIVE\svrjs\svrjs\svrjs.yaml" -Encoding utf8
|
||||||
|
} else {
|
||||||
|
Start-Process -FilePath "$nodejsDir\node.exe" -ArgumentList "-e `"var fs=require('fs'),config=JSON.parse(fs.readFileSync('$env:SYSTEMDRIVE\\svrjs\\svrjs\\config.json').toString());config.wwwroot='$env:SYSTEMDRIVE\\svrjs\\wwwroot',fs.writeFileSync('$env:SYSTEMDRIVE\\svrjs\\svrjs\\config.json',JSON.stringify(config,null,2));`"" -Wait
|
||||||
|
}
|
||||||
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs\wwwroot" -PathType "Container") {
|
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\svrjs\wwwroot" -PathType "Container") {
|
||||||
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\wwwroot") {
|
if (Test-Path -Path "$env:SYSTEMDRIVE\svrjs\wwwroot") {
|
||||||
Remove-Item -Path "$env:SYSTEMDRIVE\svrjs\wwwroot" -Recurse -Force | Out-Null
|
Remove-Item -Path "$env:SYSTEMDRIVE\svrjs\wwwroot" -Recurse -Force | Out-Null
|
||||||
|
|
Loading…
Reference in a new issue