mirror of
https://github.com/kepler155c/opus
synced 2025-10-21 18:57:41 +00:00
reorganization
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user