gnormal / gnorm

A database-first code generator for any language
https://gnorm.org
Other
488 stars 40 forks source link

Support static files #45

Closed gernest closed 6 years ago

gernest commented 6 years ago

This adds support for static files. You can add files into a directory that is defined by StaticDir in gnorm.toml and they will be copied to the directory defined by OutputDir in the gnorm.toml.

The structure of the directories is preserved.

Closes #14

natefinch commented 6 years ago

ooh, I missed this. See, this is why I need the channel :)

gernest commented 6 years ago

Done

gernest commented 6 years ago

Ping

natefinch commented 6 years ago

I tested this, but it's not prepending the outputDir to the templatePath target files. I have a fix for that which I could push to this branch if you give me rights to do it. You just need to check "Allow edits from maintainers" on this PR.

gernest commented 6 years ago

Hey, Allow edits from maintainers is checked.

natefinch commented 6 years ago

weird, I tried to push again, but no luck. still says permission denied. I'll have to poke at it in the morning.

all I did was add cfg.OutputDir to the genfile function,.and filepath.Join it to the generated path.

gernest commented 6 years ago

Uh! Maybe you can add that in a separate PR? That was my intention but I forgot to add the comment . This PR was only about copying static files.