Initial commit
This commit is contained in:
16
sys/apis/fs/gitfs.lua
Normal file
16
sys/apis/fs/gitfs.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local git = require('git')
|
||||
|
||||
local gitfs = { }
|
||||
|
||||
function gitfs.mount(dir, user, repo, branch)
|
||||
if not user or not repo then
|
||||
error('gitfs syntax: user, repo, [branch]')
|
||||
end
|
||||
|
||||
local list = git.list(user, repo, branch)
|
||||
for path, url in pairs(list) do
|
||||
fs.mount(fs.combine(dir, path), 'urlfs', url)
|
||||
end
|
||||
end
|
||||
|
||||
return gitfs
|
||||
Reference in New Issue
Block a user