fix: Handle possible line ending troubles

This commit is contained in:
Felix Rieseberg 2020-07-27 21:25:17 -07:00
parent ac0d452957
commit 9797bb115c
2 changed files with 4 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text eol=lf

View File

@ -153,6 +153,9 @@ function getPrefs(userImages = []) {
const prefsPath = path.join(__dirname, "prefs");
let prefs = fs.readFileSync(prefsTemplatePath, { encoding: "utf-8" });
// Replace line endings, just in case
prefs = prefs.replaceAll('\r\n', '\n');
if (userImages && userImages.length > 0) {
console.log(`getPrefs: Found ${userImages.length} user images`);
userImages.forEach((file) => {