Files
planet/planet.cmd
linkong e65267fe21
Some checks failed
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
release / images (push) Has been cancelled
ci / delivery (push) Has been cancelled
release: bump version to 0.65.2
2026-05-22 21:37:38 +08:00

19 lines
1.1 KiB
Batchfile

@echo off
setlocal EnableExtensions
net session >nul 2>&1
if not "%errorlevel%"=="0" (
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$script = '%~f0'; $arg = '-NoExit -NoProfile -ExecutionPolicy Bypass -Command ""& { & ''' + $script + ''' --elevated }""'; if (Get-Command wt.exe -ErrorAction SilentlyContinue) { Start-Process wt.exe -Verb RunAs -ArgumentList @('powershell.exe', $arg) } else { Start-Process powershell.exe -Verb RunAs -ArgumentList $arg }"
exit /b
)
if /i "%~1"=="--elevated" shift
echo Starting Planet in WSL as Administrator...
echo This window will stay inside WSL after startup. Close it manually when you are done.
echo.
wsl.exe -d Ubuntu --cd /home/linkong/planet -- zsh -lic "./planet.sh restart --allow-lan; planet_exit=\$?; echo; if [ \$planet_exit -eq 0 ]; then echo 'Planet restart finished successfully.'; powershell.exe -NoProfile -Command 'Start-Process "http://localhost:3000/earth"'; else echo \"Planet restart failed with exit code \$planet_exit.\"; fi; echo; echo 'Staying in WSL. Close this terminal manually when you are done.'; exec zsh -l"
exit /b %errorlevel%