You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- @param package_table table A valid package table
102
46
-- @return boolean
@@ -115,25 +59,22 @@ function unicorn.core.install(package_table)
115
59
ifgetPackageData(package_table.name) then
116
60
returntrue, getPackageData(package_table.name)
117
61
end
118
-
ifpackage_table.pkgType=="com.github" then
119
-
install_github(package_table)
120
-
elseifpackage_table.pkgType=="com.github.gist" then
121
-
install_gist(package_table)
122
-
elseifpackage_table.pkgType=="com.gitlab" then
123
-
install_gitlab(package_table)
124
-
elseifpackage_table.pkgType=="org.bitbucket" then
125
-
install_bitbucket(package_table)
126
-
elseifpackage_table.pkgType=="com.pastebin" then
127
-
install_pastebin(package_table)
128
-
elseifpackage_table.pkgType=="dev.devbin" then
129
-
install_devbin(package_table)
130
-
else
62
+
localmatch
63
+
for_,vinpairs(fs.list("/lib/unicorn/provider/")) do-- custom provider support
64
+
localprovider_name=string.gsub(v, ".lua", "")
65
+
ifpackage_table.pkgType==provider_namethen
66
+
match=true
67
+
localprovider=dofile("/lib/unicorn/provider/"..v)
68
+
provider(package_table)
69
+
end
70
+
end
71
+
ifnotmatchthen
131
72
ifpackage_table.pkgType==nilthen
132
73
error("The provided package does not have a valid package type. This is either not a package or something is wrong with the file.")
133
74
else
134
-
error("Package type " ..package_table.pkgType.." is unknown. You are either missing the appropriate package provider or something is wrong with the package.")
135
-
end
75
+
error("Package provider " ..package_table.pkgType.." is unknown. You are either missing the appropriate package provider or something is wrong with the package.")
0 commit comments