Wire everything together, now it's amen
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
@@ -44,12 +45,12 @@ type (
|
||||
func (f *Function) ResolveFileName() string {
|
||||
return f.Name + ".lua"
|
||||
}
|
||||
func (f *Function) WriteFile() error {
|
||||
func (f *Function) WriteFile(root string) error {
|
||||
if f.Name == "" {
|
||||
return fmt.Errorf("function name is empty of %+v", f)
|
||||
}
|
||||
|
||||
file, err := os.Create(f.ResolveFileName())
|
||||
file, err := os.Create(filepath.Join(root, f.ResolveFileName()))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user