Created copydir and copyfile functions in utils, now lua os.copy can copy an entire directory

This commit is contained in:
2025-09-19 22:18:34 -03:00
parent 3a068ed90b
commit 35cbc2e47c
3 changed files with 113 additions and 50 deletions

View File

@@ -106,3 +106,21 @@ func InstallPackage(file *os.File) error {
return nil
}
func ExecuteRemoveScript(path string) error {
L, err := utils_lua.GetSandBox(".")
if err != nil {
return err
}
L.SetGlobal("data_dir", lua.LFalse)
L.SetGlobal("script", lua.LString(path))
L.SetGlobal("build", lua.LNil)
if err := L.DoFile(path); err != nil {
return err
}
return nil
}