Added a lua migration helper script, hope it works correctly all the time!

This commit is contained in:
2025-08-29 18:32:01 +01:00
parent 23082c017d
commit e542574108
11 changed files with 248 additions and 54 deletions
+11 -2
View File
@@ -9,13 +9,22 @@ import (
func (a *ExpensesApp) registerLuaBinds(L *lua.LState) {
ljson.Preload(L)
L.SetGlobal("GetAllExpenses", L.NewFunction(a.luaGetAllExpenses))
// Add the decimal.Decimal operations
L.SetGlobal("AddDecimal", L.NewFunction(luadec.AddDecimal))
// Add our API
L.SetGlobal("GetAllExpenses", L.NewFunction(a.luaGetAllExpenses))
L.SetGlobal("GetExpense", L.NewFunction(a.luaGetExpense))
L.SetGlobal("UpdateExpense", L.NewFunction(a.luaUpdateExpense))
L.SetGlobal("NormalizeShare", L.NewFunction(a.luaNormalizeShares))
L.SetGlobal("InsertShare", L.NewFunction(a.luaInsertShare))
L.SetGlobal("InsertPayment", L.NewFunction(a.luaInsertPayment))
}
func returnWithError(L *lua.LState, strErr string) int {
L.Push(lua.LNil)
L.Push(lua.LBool(false))
L.Push(lua.LString(strErr))
return 2
}