@echo off setlocal pushd "%~dp0.." set "OUT=%~1" if "%OUT%"=="" set "OUT=nc-disk" if not exist "Build\$\" ( echo error: Build\$ and Build\root missing; run 'python build.py build --arch nc' first 1>&2 popd exit /b 1 ) if not exist "Build\root\" ( echo error: Build\$ and Build\root missing; run 'python build.py build --arch nc' first 1>&2 popd exit /b 1 ) if exist "%OUT%" rmdir /s /q "%OUT%" mkdir "%OUT%\hyperion" "%OUT%\root" xcopy "Build\$\*" "%OUT%\hyperion\" /E /I /H /Y >nul if errorlevel 1 ( popd exit /b 1 ) xcopy "Build\root\*" "%OUT%\root\" /E /I /H /Y >nul if errorlevel 1 ( popd exit /b 1 ) python tools\nc_mkdisk_meta.py "%OUT%\root" if errorlevel 1 ( popd exit /b 1 ) ( echo { echo "entrypoint": "hyperion:nc/boot.lua", echo "language": "Lua", echo "partitions": [ echo { "path": "hyperion", "readonly": false, "hidden": false }, echo { "path": "root", "readonly": false, "hidden": false } echo ] echo } ) > "%OUT%\build.json" echo wrote %OUT% (boot=hyperion, system=root) popd endlocal