mirror of
https://github.com/kepler155c/opus
synced 2024-12-29 10:00:26 +00:00
17 lines
331 B
Lua
17 lines
331 B
Lua
|
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
|