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:
13
pkg/main.go
13
pkg/main.go
@@ -5,6 +5,7 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
"os"
|
||||
"packets/internal/build"
|
||||
"packets/internal/utils"
|
||||
"runtime"
|
||||
|
||||
@@ -114,9 +115,16 @@ func InstallPackage(file []byte, destDir string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
L.SetGlobal("data_dir", lua.LString(filepath.Join(destDir, "data")))
|
||||
L.SetGlobal("DATA_DIR", lua.LString(filepath.Join(destDir, "data")))
|
||||
L.SetGlobal("script", lua.LString(manifest.Hooks.Build))
|
||||
|
||||
container, err := build.NewContainer(filepath.Join(destDir, "data"), manifest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
container.GetLuaState()
|
||||
|
||||
L.SetGlobal("data_dir", lua.LString(filepath.Join(destDir, "data")))
|
||||
L.SetGlobal("script", lua.LString(manifest.Hooks.Install))
|
||||
|
||||
@@ -145,9 +153,8 @@ func ExecuteRemoveScript(path string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
L.SetGlobal("data_dir", lua.LFalse)
|
||||
L.SetGlobal("DATA_DIR", lua.LFalse)
|
||||
L.SetGlobal("script", lua.LString(path))
|
||||
L.SetGlobal("build", lua.LNil)
|
||||
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
Reference in New Issue
Block a user