jan_flanders

Untitled

May 1st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.67 KB | None | 0 0
  1. //-------------------------------------------------------------------------
  2. //install.ml
  3. try
  4.     download();
  5.     command ("add-revision.bat");
  6.     compile_libs();
  7.     compile();
  8.     make_std();
  9.     Sys.chdir startdir;
  10. //-------------------------------------------------------------------------
  11. //add-revision.bat:
  12. svnversion haxe > rev.txt
  13. ::called with argument, adds rev nr to 'Usage:' in main.ml file (also backs up the original main.ml to not mess up svn status)
  14. neko addrevision.n rev.txt
  15. //-------------------------------------------------------------------------
  16. //Main.hx
  17. package;
  18. import neko.Sys;
  19. import neko.Lib;
  20. import neko.FileSystem;
  21. import neko.io.File;
  22.  
  23. class Main
  24. {
  25.     public static function main()
  26.     {
  27.         var args:Array<String> = Sys.args();
  28.         if(args.length==0)
  29.         {
  30.             if(FileSystem.exists("./haxe/maintemp.ml"))
  31.             {
  32.                 if(FileSystem.exists("./haxe/main.ml"))
  33.                     FileSystem.deleteFile("./haxe/main.ml");
  34.                 //FileSystem.rename("/haxe/maintemp.ml","./haxe/main.ml");
  35.                 File.write("./haxe/main.ml",true).write(File.getBytes("./haxe/maintemp.ml"));
  36.                 FileSystem.deleteFile("./haxe/maintemp.ml");
  37.             }
  38.         }
  39.         else
  40.         {
  41.             //neko.io.File.copy("./haxe/main.ml", "./haxe/maintemp.ml");
  42.             File.write("./haxe/maintemp.ml",true).write(File.getBytes("./haxe/main.ml"));
  43.             var rev = File.getContent(args[0]).split("\r\n").join("").split("M").join("");
  44.             File.write(args[0],false).writeString(rev);
  45.             var newTxt = File.getContent("./haxe/main.ml");
  46.             if(newTxt.indexOf("\r\n")!= -1)
  47.                 newTxt = newTxt.split("\r").join("\r\n");
  48.             newTxt = newTxt.split("- (c)2005").join("r_" + rev + " - (c)2005");
  49.             File.write("./haxe/main.ml",false).writeString(newTxt);
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment