Actually add add_lib_ppl, whoops.
This commit is contained in:
		
							
								
								
									
										13
									
								
								add_lib_ppl/pkgmeta.ltn
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								add_lib_ppl/pkgmeta.ltn
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | { | ||||||
|  |     ["version"] = "0.1.0", | ||||||
|  |     ["dependencies"] = { | ||||||
|  |     	 | ||||||
|  |     }, | ||||||
|  |     ["description"] = "Makes require look in /lib. Don't ask how. You really don't want to know.", | ||||||
|  |     ["files"] = { | ||||||
|  |         ["startup"] = { | ||||||
|  |             ".__add_lib_ppl.lua" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     ["restart_on_inst"]=1, | ||||||
|  | } | ||||||
							
								
								
									
										21
									
								
								add_lib_ppl/startup/.__add_lib_ppl.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								add_lib_ppl/startup/.__add_lib_ppl.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | local function loader(mn) | ||||||
|  | 	local at=nil | ||||||
|  | 	if fs.exists(shell.dir().."/lib/"..mn..".lua") then | ||||||
|  | 		at=shell.dir().."/lib/"..mn..".lua" | ||||||
|  | 	elseif fs.exists("/lib/"..mn..".lua") then | ||||||
|  | 		at="/lib/"..mn..".lua" | ||||||
|  | 	end | ||||||
|  | 	if at then | ||||||
|  | 		return function() return dofile(at) end | ||||||
|  | 	end | ||||||
|  | 	return false,"\t\tno file '/lib/"..mn..".lua\n\t\tno file '"..shell.dir().."/lib/"..mn..".lua" | ||||||
|  | end | ||||||
|  |  | ||||||
|  | local osrun=_G.os.run | ||||||
|  | function _G.os.run(e,p,...) | ||||||
|  | 	if e.package then | ||||||
|  | 		table.insert(e.package.loaders,loader) | ||||||
|  | 	end | ||||||
|  | 	return osrun(e,p,...) | ||||||
|  | end | ||||||
|  |  | ||||||
		Reference in New Issue
	
	Block a user