JonasJurczok / faketorio

Run automatic tests for your mod inside Factorio
MIT License
18 stars 4 forks source link

Look in user's home directory for .faketorio file #82

Open danielbrauer opened 5 years ago

danielbrauer commented 5 years ago

Uses the HOME environment variable on Unix, and USERPROFILE on Windows. I've tested the former and it works great. Not sure about the latter.

I didn't add an automated test for the normal case because it would really just be re-implementing the behaviour to get a string to compare against. I did test for the case where we don't find the environment variable, though.

JonasJurczok commented 5 years ago

To make the build pass can you please duplicate the execute block in https://github.com/JonasJurczok/faketorio/blob/master/.luacheckrc#L8 and change execute to getenv? This tells luacheck that calling that undefined global function is actually okay :)