npc.bat 909 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. rem switch to the npc folder
  4. cd ..\..\npc\
  5. rem store the output destination
  6. set OUT=%CD%\scripts_custom.conf
  7. rem switch to the custom folder
  8. cd custom\
  9. rem newline
  10. echo. >> !OUT!
  11. rem header
  12. echo // Custom Scripts >> !OUT!
  13. rem store the current directory
  14. set C=%CD%
  15. rem make sure that no paranthesis close is unescaped inside the path
  16. set C=!C:^)=^^^)!
  17. for /R . %%f in (*.txt) do (
  18. rem store it to allow delayed expansion
  19. set B=%%f
  20. rem store relative path for compare
  21. set R=!B:%C%\=!
  22. echo npc: npc\custom\!R!>>!OUT!
  23. )
  24. rem switch to the test folder
  25. cd ..\test
  26. rem header
  27. echo // Test scripts >> !OUT!
  28. rem store the current directory
  29. set C=%CD%
  30. rem make sure that no paranthesis close is unescaped inside the path
  31. set C=!C:^)=^^^)!
  32. for /R . %%f in (*.txt) do (
  33. rem store it to allow delayed expansion
  34. set B=%%f
  35. echo npc: npc\test\!B:%C%\=!>>!OUT!
  36. )