1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-21 18:57:41 +00:00

reorganization

This commit is contained in:
kepler155c@gmail.com
2017-09-15 01:08:04 -04:00
parent b5ee5db16b
commit 64c68f2662
54 changed files with 175 additions and 15800 deletions

View File

@@ -9,8 +9,10 @@ function gitfs.mount(dir, user, repo, branch)
local list = git.list(user, repo, branch)
for path, entry in pairs(list) do
local node = fs.mount(fs.combine(dir, path), 'urlfs', entry.url)
node.size = entry.size
if not fs.exists(fs.combine(dir, path)) then
local node = fs.mount(fs.combine(dir, path), 'urlfs', entry.url)
node.size = entry.size
end
end
end

View File

@@ -38,6 +38,11 @@ end
function urlfs.open(node, fn, fl)
if fl == 'w' or fl == 'wb' then
fs.delete(fn)
return fs.open(fn, fl)
end
if fl ~= 'r' and fl ~= 'rb' then
error('Unsupported mode')
end