changing shellscripts to lua scripts for safety and control
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/klauspost/compress/zstd"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
lua "github.com/yuin/gopher-lua"
|
||||
"golang.org/x/net/ipv4"
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
@@ -534,6 +535,16 @@ func Install(packagepath string, serial uint) error {
|
||||
|
||||
// TODO LUA SCRIPT
|
||||
|
||||
L := lua.NewState()
|
||||
defer L.Close()
|
||||
|
||||
L.SetGlobal("packets_package_dir", lua.LString(cfg.Config.DataDir))
|
||||
L.SetGlobal("packets_bin_dir", lua.LString(cfg.Config.BinDir))
|
||||
|
||||
if err := L.DoFile(manifest.Hooks.Install); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
fmt.Printf("Package %s fully installed\n", name)
|
||||
|
||||
var insert = Installed{
|
||||
|
||||
Reference in New Issue
Block a user