doc/haxelib/using_haxelib [en]

All languages

Differences between version #7136 and #8347

164a165,177
> 
> ====== Getting the directory of haxelib being called ======
> 
> When run.n is called from haxelib, the current working directory will be set to the library directory (eg. /usr/lib/haxe/lib/somelib/1,0/). The directory of haxelib being called will instead be passed as an extra argument, put at the end of the argument array. So to reset the cwd, use the following code:
> <code haxe>
> var last:String = (new neko.io.Path(args[args.length-1])).toString();
> var slash = last.substr(-1);
> if (slash=="/"|| slash=="\\") 
> 	last = last.substr(0,last.length-1);
> if (neko.FileSystem.exists(last) && neko.FileSystem.isDirectory(last)) {
> 	neko.Sys.setCwd(last);
> }
> </code>
\ No newline at end of file

	
Ver Date User Action
#19873 2014-01-03 03:28:15 jason View | Diff
#18002 2013-03-27 12:20:26 rjanicek View | Diff
#17999 2013-03-27 05:01:13 rjanicek View | Diff
#15148 2012-07-22 08:41:35 jason View | Diff
#14426 2012-07-14 12:39:26 ncannasse View | Diff
#12063 2011-12-20 11:52:55 ncannasse View | Diff
#8347 2010-03-24 09:53:49 AndyLi View | Diff
#7136 2009-10-24 16:13:00 ncannasse View | Diff
#7135 2009-10-24 16:06:01 ncannasse View | Diff
#7012 2009-09-17 10:18:41 Kolan View | Diff
#5542 2009-02-27 05:36:18 jjdonald View | Diff
#5541 2009-02-27 05:34:45 jjdonald View | Diff
#5540 2009-02-27 05:33:37 jjdonald View | Diff
#5539 2009-02-26 16:32:37 jjdonald View | Diff
#4780 2008-10-28 00:07:09 baurel View | Diff
#4779 2008-10-28 00:07:09 baurel Set title to Using haxelib

Previous | Next