some bug fixes, manifest.toml don't exist anyomre and all data for installation will be in one file name Packet.lua
This commit is contained in:
28
internal/utils/lua/git.go
Normal file
28
internal/utils/lua/git.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package utils_lua
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/go-git/go-git"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
)
|
||||
|
||||
func LGitClone(L *lua.LState) int {
|
||||
uri := L.CheckString(1)
|
||||
output := L.CheckString(2)
|
||||
|
||||
_, err := git.PlainClone(output, false, &git.CloneOptions{
|
||||
URL: uri,
|
||||
Progress: os.Stdout,
|
||||
})
|
||||
if err != nil {
|
||||
L.Push(lua.LFalse)
|
||||
L.Push(lua.LString(err.Error()))
|
||||
return 2
|
||||
}
|
||||
L.Push(lua.LTrue)
|
||||
L.Push(lua.LNil)
|
||||
return 2
|
||||
}
|
||||
|
||||
func LGitCheckout(L)
|
||||
Reference in New Issue
Block a user