Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------------------------------------
- //install.ml
- try
- download();
- command ("add-revision.bat");
- compile_libs();
- compile();
- make_std();
- Sys.chdir startdir;
- //-------------------------------------------------------------------------
- //add-revision.bat:
- svnversion haxe > rev.txt
- ::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)
- neko addrevision.n rev.txt
- //-------------------------------------------------------------------------
- //Main.hx
- package;
- import neko.Sys;
- import neko.Lib;
- import neko.FileSystem;
- import neko.io.File;
- class Main
- {
- public static function main()
- {
- var args:Array<String> = Sys.args();
- if(args.length==0)
- {
- if(FileSystem.exists("./haxe/maintemp.ml"))
- {
- if(FileSystem.exists("./haxe/main.ml"))
- FileSystem.deleteFile("./haxe/main.ml");
- //FileSystem.rename("/haxe/maintemp.ml","./haxe/main.ml");
- File.write("./haxe/main.ml",true).write(File.getBytes("./haxe/maintemp.ml"));
- FileSystem.deleteFile("./haxe/maintemp.ml");
- }
- }
- else
- {
- //neko.io.File.copy("./haxe/main.ml", "./haxe/maintemp.ml");
- File.write("./haxe/maintemp.ml",true).write(File.getBytes("./haxe/main.ml"));
- var rev = File.getContent(args[0]).split("\r\n").join("").split("M").join("");
- File.write(args[0],false).writeString(rev);
- var newTxt = File.getContent("./haxe/main.ml");
- if(newTxt.indexOf("\r\n")!= -1)
- newTxt = newTxt.split("\r").join("\r\n");
- newTxt = newTxt.split("- (c)2005").join("r_" + rev + " - (c)2005");
- File.write("./haxe/main.ml",false).writeString(newTxt);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment