diff DependencyLoader_Bootstrap/bootstrap.lua @ 9:5362e308c3eb

renamed the old DependencyLoader module to DependencyLoader_Bootstrap renamed DependencyLoader_Core to DependencyLoader
author mckenziemc
date Sun, 05 Dec 2010 00:12:57 -0800
parents DependencyLoader/bootstrap.lua@9852fcd5e59e
children e0a4a8b5b389
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DependencyLoader_Bootstrap/bootstrap.lua	Sun Dec 05 00:12:57 2010 -0800
@@ -0,0 +1,36 @@
+--	bootstrap.lua
+--	Bootstrap code for DependencyLoader, allowing 
+--	the user to successfully load it without 
+--	explicitly enabling its own dependencies.
+
+
+local addonName, addonTable = ...
+
+--	TODO: move and use dependency parsing function here?
+local dependencies = {"LibStub", "LibPrint-1.0", "Ace3"}
+
+local canLoad = true
+for _, addon in pairs(dependencies) do
+	local reason = select(6, GetAddOnInfo(addon))
+	
+	if reason ~= nil and reason ~= "DISABLED" then
+		canLoad = false
+		break
+	end
+end
+
+if not canLoad then
+	print("Can't load DependencyLoader")
+	return
+end
+
+
+print("Loading DependencyLoader")
+
+for _, addon in pairs(dependencies) do
+	EnableAddOn(addon)
+end
+
+EnableAddOn("DependencyLoader_Core")
+LoadAddOn("DependencyLoader_Core")
+