Skip to content

Commit

Permalink
chore: use os specific line endings for version updates (#763)
Browse files Browse the repository at this point in the history
On windows (with git config core.autocrlf=true as recommended for cross os projects)
the version-update script created unix files (LF only). This caused that git sees a
lot modified files after bootstrap.

Use os.EOL to ensure line endings match the os used.
  • Loading branch information
Flarna authored Feb 4, 2020
1 parent de4c19e commit 8b7e58c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/version-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

const fs = require('fs');
const os = require('os');
const path = require('path');

const appRoot = process.cwd();
Expand Down Expand Up @@ -44,4 +45,4 @@ export const VERSION = '${pjson.version}';

const fileUrl = path.join(appRoot, "src", "version.ts")

fs.writeFileSync(fileUrl, content);
fs.writeFileSync(fileUrl, content.replace(/\n/g, os.EOL));

0 comments on commit 8b7e58c

Please sign in to comment.