diff --git a/scripts/run-windows.ps1 b/scripts/lib/launch-windows.ps1 similarity index 94% rename from scripts/run-windows.ps1 rename to scripts/lib/launch-windows.ps1 index f93b03f..f8beb74 100644 --- a/scripts/run-windows.ps1 +++ b/scripts/lib/launch-windows.ps1 @@ -1,4 +1,5 @@ -# Chamado por scripts/pitiupi.sh (WSL ou Git Bash) e por scripts/pitiupi.cmd. +# Chamado por scripts/pitiupi.sh e por scripts/pitiupi.cmd. +# Não é um comando de quem baixa o projeto. # Não copia plugins: quem chama já deixou o JAR e o PITIUPI_HOME prontos. param( [Parameter(Mandatory = $true)][string]$PitiupiHome, diff --git a/scripts/pitiupi.cmd b/scripts/pitiupi.cmd index 5e353b2..be4043a 100644 --- a/scripts/pitiupi.cmd +++ b/scripts/pitiupi.cmd @@ -28,7 +28,7 @@ set "PITIUPI_PLUGINS=%CD%\.pitiupi\plugins" powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$repo = $env:PITIUPI_REPO; $dest = $env:PITIUPI_PLUGINS; $reg = Get-Content -Raw (Join-Path $repo 'plugins.registry.json') | ConvertFrom-Json; foreach ($p in $reg.plugins) { $dir = Join-Path $repo ($p.dir -replace '/','\'); if ($p.build -ne 'ant') { Write-Error ('build nao suportado neste prompt: ' + $p.build); exit 1 }; & ant -f (Join-Path $dir 'build.xml') jar; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; $src = Join-Path $dir ($p.jar -replace '/','\'); if (-not (Test-Path -LiteralPath $src)) { Write-Error ('JAR ausente: ' + $src); exit 1 }; Copy-Item -LiteralPath $src -Destination (Join-Path $dest ($p.id + '.jar')) -Force }" if errorlevel 1 exit /b 1 -powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0run-windows.ps1" -PitiupiHome "%CD%\.pitiupi" -Jar "%CD%\pitiupi\dist\pitiupi.jar" +powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0lib\launch-windows.ps1" -PitiupiHome "%CD%\.pitiupi" -Jar "%CD%\pitiupi\dist\pitiupi.jar" if errorlevel 1 exit /b 1 echo Janela aberta no Windows. Cabo e Wi-Fi sao as placas desta maquina. echo Plugins em %CD%\.pitiupi\plugins diff --git a/scripts/pitiupi.sh b/scripts/pitiupi.sh index 1d3974e..fa79528 100755 --- a/scripts/pitiupi.sh +++ b/scripts/pitiupi.sh @@ -266,7 +266,7 @@ launch_windows_java() { fi home_win="$(to_windows_path "${PITIUPI_HOME}")" jar_win="$(to_windows_path "${CORE}/dist/pitiupi.jar")" - ps1="$(to_windows_path "${REPO_ROOT}/scripts/run-windows.ps1")" + ps1="$(to_windows_path "${REPO_ROOT}/scripts/lib/launch-windows.ps1")" powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${ps1}" -PitiupiHome "${home_win}" -Jar "${jar_win}" }