2021-10-04 20:41:49 +03:00
|
|
|
$ErrorActionPreference = "Stop"
|
2022-10-31 19:23:53 +03:00
|
|
|
$SUBMODULE_BRANCH = $args[0]
|
2021-10-04 20:41:49 +03:00
|
|
|
|
|
|
|
if ($null -eq (Get-ChildItem env:VIRTUAL_ENV -ErrorAction SilentlyContinue))
|
|
|
|
{
|
|
|
|
Write-Output "This script requires that the Chia Python virtual environment is activated."
|
|
|
|
Write-Output "Execute '.\venv\Scripts\Activate.ps1' before running."
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($null -eq (Get-Command node -ErrorAction SilentlyContinue))
|
|
|
|
{
|
|
|
|
Write-Output "Unable to find Node.js"
|
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
Write-Output "Running 'git submodule update --init --recursive'."
|
|
|
|
Write-Output ""
|
|
|
|
git submodule update --init --recursive
|
2022-10-31 19:23:53 +03:00
|
|
|
if ( $SUBMODULE_BRANCH ) {
|
|
|
|
git fetch --all
|
|
|
|
git reset --hard $SUBMODULE_BRANCH
|
|
|
|
Write-Output ""
|
|
|
|
Write-Output "Building the GUI with branch $SUBMODULE_BRANCH"
|
|
|
|
Write-Output ""
|
|
|
|
}
|
|
|
|
|
2021-10-04 20:41:49 +03:00
|
|
|
|
2021-10-29 20:45:13 +03:00
|
|
|
Push-Location
|
|
|
|
try {
|
|
|
|
Set-Location chia-blockchain-gui
|
2021-10-04 20:41:49 +03:00
|
|
|
|
2021-10-29 20:45:13 +03:00
|
|
|
$ErrorActionPreference = "SilentlyContinue"
|
2022-01-20 03:52:20 +03:00
|
|
|
npm ci --loglevel=error
|
2021-10-29 20:45:13 +03:00
|
|
|
npm audit fix
|
|
|
|
npm run build
|
|
|
|
py ..\installhelper.py
|
2021-10-04 20:41:49 +03:00
|
|
|
|
2021-10-29 20:45:13 +03:00
|
|
|
Write-Output ""
|
|
|
|
Write-Output "Chia blockchain Install-gui.ps1 completed."
|
|
|
|
Write-Output ""
|
|
|
|
Write-Output "Type 'cd chia-blockchain-gui' and then 'npm run electron' to start the GUI."
|
|
|
|
} finally {
|
|
|
|
Pop-Location
|
|
|
|
}
|