Skip to content

fix(config): Use ioutil.WriteFile on Windows

Kerri Miller requested to merge github/fork/andhe/renameio-except-windows into trunk

Created by: andhe

As reported renameio doesn't work on Windows and apparently there's no way to do atomic file replace on Windows.

We thus create a helper function in a separate file that uses renameio but say it should not be built on windows, then hook in a windows- specific implementation of that function which uses ioutil.WriteFile which is not safe but gets the job done.

While at it also tighten up the permissions on the config file as it might contain sensitive information (like the token).

Fixes #210 (closed)

Merge request reports