
@echo off
@chcp 65001
CD /D "%~dp1"
cls


set SrcExt0=*
set DestExt0=pkg

set DestPath=%~dp1

set Src0=%~nx1
If Not Exist "%Src0%\*.%SrcExt0%" (echo. && echo  [ %Src0% ] Not Found. && echo. && pause && Goto End)

set DestPath=%~dp1
set Dest0=%Src0%-Repack

set exe=%~dp0_exe\node.exe
set ScriptJS=%~dp0_exe\toxana-tkit-1.2\bin\tx-pkgarc.js
set Opt=pack -v -o



for /D %%f in ("%Src0%\*.%SrcExt0%") do (
If Not Exist "%Dest0%" mkdir "%Dest0%"

"%exe%" "%ScriptJS%" %Opt% "%Dest0%\%%~nxf.%DestExt0%" "%%f"
echo.

If Not Exist "%Dest0%\%%~nxf.%DestExt0%" pause
)



:End
REM  pause
