@echo off
REM Package test apps as .mosis files

setlocal enabledelayedexpansion

for /d %%d in (*) do (
    if exist "%%d\manifest.json" (
        echo Packaging %%d...
        cd %%d
        if exist "..\%%d.mosis" del "..\%%d.mosis"
        tar -a -cf "..\%%d.mosis" *
        cd ..
        echo Created %%d.mosis
    )
)

echo.
echo Done! Package files:
dir /b *.mosis 2>nul

endlocal
