@@ -347,29 +347,29 @@ func (p *Plural) handleLuaTemplate(c *cli.Context) error {
347347 if err != nil {
348348 return err
349349 }
350- proc := luautils .NewProcessor (dir )
351- defer proc . L .Close ()
350+ L := luautils .NewLuaState (dir )
351+ defer L .Close ()
352352
353353 // Register global values and valuesFiles in Lua
354- valuesTable := proc . L .NewTable ()
355- proc . L .SetGlobal ("values" , valuesTable )
354+ valuesTable := L .NewTable ()
355+ L .SetGlobal ("values" , valuesTable )
356356
357- valuesFilesTable := proc . L .NewTable ()
358- proc . L .SetGlobal ("valuesFiles" , valuesFilesTable )
359- proc . L .SetGlobal ("cluster" , luautils .GoValueToLuaValue (proc . L , ctx ["cluster" ]))
360- proc . L .SetGlobal ("configuration" , luautils .GoValueToLuaValue (proc . L , ctx ["configuration" ]))
361- proc . L .SetGlobal ("contexts" , luautils .GoValueToLuaValue (proc . L , ctx ["contexts" ]))
362- proc . L .SetGlobal ("imports" , luautils .GoValueToLuaValue (proc . L , ctx ["imports" ]))
357+ valuesFilesTable := L .NewTable ()
358+ L .SetGlobal ("valuesFiles" , valuesFilesTable )
359+ L .SetGlobal ("cluster" , luautils .GoValueToLuaValue (L , ctx ["cluster" ]))
360+ L .SetGlobal ("configuration" , luautils .GoValueToLuaValue (L , ctx ["configuration" ]))
361+ L .SetGlobal ("contexts" , luautils .GoValueToLuaValue (L , ctx ["contexts" ]))
362+ L .SetGlobal ("imports" , luautils .GoValueToLuaValue (L , ctx ["imports" ]))
363363
364- if err := proc . L .DoString (luaStr ); err != nil {
364+ if err := L .DoString (luaStr ); err != nil {
365365 return err
366366 }
367367
368- if err := luautils .MapLua (proc . L .GetGlobal ("values" ).(* lua.LTable ), & values ); err != nil {
368+ if err := luautils .MapLua (L .GetGlobal ("values" ).(* lua.LTable ), & values ); err != nil {
369369 return err
370370 }
371371
372- if err := luautils .MapLua (proc . L .GetGlobal ("valuesFiles" ).(* lua.LTable ), & valuesFiles ); err != nil {
372+ if err := luautils .MapLua (L .GetGlobal ("valuesFiles" ).(* lua.LTable ), & valuesFiles ); err != nil {
373373 return err
374374 }
375375
0 commit comments