Skip to content

Commit 0702650

Browse files
committed
Minor bugfixes
1 parent e2bf0c2 commit 0702650

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

bsrocks/downloaders/github.lua

-19
This file was deleted.

bsrocks/downloaders/init.lua

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
local tree = require "bsrocks.downloaders.tree"
2+
13
local downloaders = {
2-
require "bsrocks.downloaders.github",
4+
-- GitHub
5+
function(source, files)
6+
local url = source.url
7+
if not url then return end
8+
9+
local repo = url:match("git://github%.com/(.*)")
10+
local branch = source.branch or source.tag or "master"
11+
if not repo then
12+
-- If we have the archive then we can also fetch from GitHub
13+
repo, branch = url:match("https?://github%.com/(.*)/archive/(.*).tar.gz")
14+
if not repo then return end
15+
end
16+
17+
print("Downloading " .. repo .. "@" .. branch)
18+
return tree('https://raw.github.com/'..repo..'/'..branch..'/', files)
19+
end,
20+
321
}
422

523
return function(source, files)

bsrocks/rocks/install.lua

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ local function save(rockS, patchS)
4242
files = applyPatches(downloaded, downloadPatch, patchS.patches or {}, patchS.added or {}, patchS.removed or {})
4343
end
4444

45-
rockspec.saveFiles(rockS, downloaded, installDirectory)
46-
4745
local build = rockS.build
4846
if build then
4947
if build.modules then
@@ -149,7 +147,7 @@ local function install(name, version, constraints)
149147
local patchManifest = patchspec.findPatchspec(name)
150148

151149
if not version then
152-
if patchspec then
150+
if patchManifest then
153151
version = patchManifest.patches[name]
154152
else
155153
version = rockspec.latestVersion(rockManifest, name, constraints)

0 commit comments

Comments
 (0)