Advertisement
kotoroshinoto

link TFC source to forge source (WIN BATCH CMD)

Aug 24th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.77 KB | None | 0 0
  1. @echo off
  2. set TFC_ECLIPSEDIR=..\TFC\mcp\src\minecraft
  3. REM this script expects to be in the directory above the TFC source (a sibling of TFCraft)
  4. set THISDIR=%cd%
  5. echo removing local symbolic link directory
  6. rmdir /S /Q links
  7. echo removing eclipse TFC link directory
  8. rmdir /S /Q  %TFC_ECLIPSEDIR%\TFC
  9. REM remove dead links
  10. echo checking for symlinks to remove in eclipse directory
  11. rem dir /AL /B %TFC_ECLIPSEDIR%
  12. echo deleting file symlinks in %TFC_ECLIPSEDIR%
  13. del /AL /Q %TFC_ECLIPSEDIR%\*
  14. echo deleting directory symlinks in %TFC_ECLIPSEDIR%
  15. for /f "usebackq" %%f in (`dir /B /ALD %TFC_ECLIPSEDIR%`) do (
  16.     rmdir /S /Q %TFC_ECLIPSEDIR%\%%f
  17. )
  18.  
  19. rem for i in $(file %TFC_ECLIPSEDIR%/* | grep broken | cut -d : -f 1); do rm $i; done
  20. REM remove TFC directory used to merge links
  21. echo making eclipse TFC link directory
  22. mkdir %TFC_ECLIPSEDIR%\TFC
  23. echo making local symbolic link directory
  24. mkdir links
  25. echo making local symbolic links
  26. mklink /D links\API\ "%THISDIR%\TFCraft\TFC API\TFC"
  27. mklink /D links\SHARED\ "%THISDIR%\TFCraft\TFC_Shared\src\TFC"
  28. mklink /D links\ASM\ "%THISDIR%\TFCraft\TFC Asm "
  29. mklink /D links\assets\ "%THISDIR%\TFCraft\TFC Resources\assets"
  30.  
  31. echo link assets
  32. rem echo mklink /D %TFC_ECLIPSEDIR% %THISDIR%\links\assets
  33. if exist {%TFC_ECLIPSEDIR%\assets} rmdir /S /Q %TFC_ECLIPSEDIR%\assets
  34. mklink /D %TFC_ECLIPSEDIR%\assets %THISDIR%\links\assets
  35.  
  36. echo link the files in the API directory to the target TFC
  37. for /D %%f in (%THISDIR%\links\API\*) do (
  38.     rem echo mklink /D %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  39.     if exist {%TFC_ECLIPSEDIR%\TFC\%%~nf} rmdir /S /Q %TFC_ECLIPSEDIR%\TFC\%%~nf
  40.     mklink /D %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  41. )
  42. for %%f in (%THISDIR%\links\API\*) do (
  43.     rem echo mklink %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  44.     if exist {%TFC_ECLIPSEDIR%\TFC\%%~nf} del /Q %TFC_ECLIPSEDIR%\TFC\%%~nf
  45.     mklink %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  46. )
  47. echo link the files in the Shared directory to the target TFC
  48. for /D %%f in (%THISDIR%\links\SHARED\*) do (
  49.     rem echo mklink /D %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  50.     if exist {%TFC_ECLIPSEDIR%\TFC\%%~nf} rmdir /S /Q %TFC_ECLIPSEDIR%\TFC\%%~nf
  51.     mklink /D %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  52. )
  53. for %%f in (%THISDIR%\links\SHARED\*) do (
  54.     rem echo mklink %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  55.     if exist {%TFC_ECLIPSEDIR%\TFC\%%~nf} del /Q %TFC_ECLIPSEDIR%\TFC\%%~nf
  56.     mklink %TFC_ECLIPSEDIR%\TFC\%%~nf %%f
  57. )
  58. echo link the files in ASM to the target TFC directory
  59. for /D %%f in (%THISDIR%\links\ASM\*) do (
  60.     rem echo mklink /D %TFC_ECLIPSEDIR%\%%~nf %%f
  61.     if exist {%TFC_ECLIPSEDIR%\%%~nf} rmdir /S /Q %TFC_ECLIPSEDIR%\%%~nf
  62.     mklink /D %TFC_ECLIPSEDIR%\%%~nf %%f
  63. )
  64. for %%f in (%THISDIR%\links\ASM\*) do (
  65.     rem echo mklink %TFC_ECLIPSEDIR%\%%~nf %%f
  66.     if exist {%TFC_ECLIPSEDIR%\%%~nf} del /Q %TFC_ECLIPSEDIR%\%%~nf
  67.     mklink %TFC_ECLIPSEDIR%\%%~nf %%f
  68. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement