lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v206 126 lines 4.5 kB view raw
1diff --git a/extra/haxelib_src/src/tools/haxelib/Main.hx b/extra/haxelib_src/src/tools/haxelib/Main.hx 2index a44a785..0eb811a 100644 3--- a/extra/haxelib_src/src/tools/haxelib/Main.hx 4+++ b/extra/haxelib_src/src/tools/haxelib/Main.hx 5@@ -996,21 +996,26 @@ class Main { 6 } 7 8 function checkRec( prj : String, version : String, l : List<{ project : String, version : String, info : Infos }> ) { 9- var pdir = getRepository() + Data.safe(prj); 10- if( !FileSystem.exists(pdir) ) 11- throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'"; 12- var version = if( version != null ) version else getCurrent(pdir); 13- var vdir = pdir + "/" + Data.safe(version); 14- if( vdir.endsWith("dev") ) 15- vdir = getDev(pdir); 16- if( !FileSystem.exists(vdir) ) 17- throw "Library "+prj+" version "+version+" is not installed"; 18- for( p in l ) 19- if( p.project == prj ) { 20- if( p.version == version ) 21- return; 22- throw "Library "+prj+" has two version included "+version+" and "+p.version; 23- } 24+ var vdir = this.getNixLib(prj); 25+ if (vdir == null) { 26+ var pdir = getRepository() + Data.safe(prj); 27+ if( !FileSystem.exists(pdir) ) 28+ throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'"; 29+ var version = if( version != null ) version else getCurrent(pdir); 30+ var vdir = pdir + "/" + Data.safe(version); 31+ if( vdir.endsWith("dev") ) 32+ vdir = getDev(pdir); 33+ if( !FileSystem.exists(vdir) ) 34+ throw "Library "+prj+" version "+version+" is not installed"; 35+ for( p in l ) 36+ if( p.project == prj ) { 37+ if( p.version == version ) 38+ return; 39+ throw "Library "+prj+" has two version included "+version+" and "+p.version; 40+ } 41+ } else { 42+ version = null; 43+ } 44 var json = try File.getContent(vdir+"/"+Data.JSON) catch( e : Dynamic ) null; 45 var inf = Data.readData(json,false); 46 l.add({ project : prj, version : version, info: inf }); 47@@ -1025,15 +1030,21 @@ class Main { 48 var a = args[argcur++].split(":"); 49 checkRec(a[0],a[1],list); 50 } 51- var rep = getRepository(); 52 for( d in list ) { 53- var pdir = Data.safe(d.project)+"/"+Data.safe(d.version)+"/"; 54- var dir = rep + pdir; 55- try { 56- dir = getDev(rep+Data.safe(d.project)); 57+ var dir = this.getNixLib(d.project); 58+ var pdir = Data.safe(d.project)+"/"; 59+ if (dir == null) { 60+ var rep = getRepository(); 61+ pdir += Data.safe(d.version)+"/"; 62+ dir = rep + pdir; 63+ try { 64+ dir = getDev(rep+Data.safe(d.project)); 65+ dir = Path.addTrailingSlash(dir); 66+ pdir = dir; 67+ } catch( e : Dynamic ) {} 68+ } else { 69 dir = Path.addTrailingSlash(dir); 70- pdir = dir; 71- } catch( e : Dynamic ) {} 72+ } 73 var ndir = dir + "ndll"; 74 if( FileSystem.exists(ndir) ) { 75 var sysdir = ndir+"/"+Sys.systemName(); 76@@ -1153,21 +1164,39 @@ class Main { 77 print(' Path: $devPath'); 78 } 79 80+ function getNixLib(project:String):Null<String> 81+ { 82+ var hlibPath = Sys.getEnv("HAXELIB_PATH"); 83+ if (hlibPath != null) { 84+ for (libDir in hlibPath.split(":")) { 85+ var fullpath = libDir; 86+ fullpath += libDir.substr(-1, 1) == "/" ? "" : "/"; 87+ fullpath += Data.safe(project); 88+ if (FileSystem.exists(fullpath)) 89+ return fullpath; 90+ } 91+ } 92+ return null; 93+ } 94+ 95 function run() { 96- var rep = getRepository(); 97 var project = param("Library"); 98 var temp = project.split(":"); 99 project = temp[0]; 100- var pdir = rep + Data.safe(project); 101- if( !FileSystem.exists(pdir) ) 102- throw "Library "+project+" is not installed"; 103- pdir += "/"; 104- var version = temp[1] != null ? temp[1] : getCurrent(pdir); 105- var dev = try getDev(pdir) catch ( e : Dynamic ) null; 106- var vdir = dev!=null ? dev : pdir + Data.safe(version); 107- var rdir = vdir + "/run.n"; 108- if( !FileSystem.exists(rdir) ) 109- throw "Library "+project+" version "+version+" does not have a run script"; 110+ var vdir = this.getNixLib(project); 111+ if (vdir == null) { 112+ var rep = getRepository(); 113+ var pdir = rep + Data.safe(project); 114+ if( !FileSystem.exists(pdir) ) 115+ throw "Library "+project+" is not installed"; 116+ pdir += "/"; 117+ var version = temp[1] != null ? temp[1] : getCurrent(pdir); 118+ var dev = try getDev(pdir) catch ( e : Dynamic ) null; 119+ vdir = dev!=null ? dev : pdir + Data.safe(version); 120+ var rdir = vdir + "/run.n"; 121+ if( !FileSystem.exists(rdir) ) 122+ throw "Library "+project+" version "+version+" does not have a run script"; 123+ } 124 args.push(Sys.getCwd()); 125 Sys.setCwd(vdir); 126 var cmd = "neko run.n";