Skip to content

Commit b7c77a6

Browse files
author
Kelly Selden
committed
fixed mixed EOL in favor of cross platform
1 parent 0d78e94 commit b7c77a6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

__tests__/bin-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ describe('bin acceptance', function() {
145145
expect(stdout).toMatch('Done! Some files could not be upgraded automatically. See MODULE_REPORT.md.\n');
146146

147147
let expectedOutput = fs.readFileSync(path.join(__dirname, 'expected', 'MODULE_REPORT.md'), 'utf8')
148-
.replace(/\//, path.sep);
148+
.replace(/\//, path.sep)
149+
.replace(/\r?\n/g, require('os').EOL);
149150
let actualOutput = fs.readFileSync(path.join(tmpPath, 'MODULE_REPORT.md'), 'utf8');
150151

151152
expect(actualOutput).toEqual(expectedOutput);

bin/ember-modules-codemod.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ function buildReport() {
9999
}
100100
});
101101

102-
fs.writeFileSync("MODULE_REPORT.md", "## Module Report\n" + report.join("\n"));
102+
let file = "## Module Report\n" + report.join("\n");
103+
104+
// normalize line endings, so we don't end up with mixed
105+
file = file.replace(/\r?\n/g, require('os').EOL);
106+
107+
fs.writeFileSync("MODULE_REPORT.md", file);
103108
console.log(chalk.yellow("\nDone! Some files could not be upgraded automatically. See " + chalk.blue("MODULE_REPORT.md") + "."));
104109
} else {
105110
console.log(chalk.green("\nDone! All uses of the Ember global have been updated."));

0 commit comments

Comments
 (0)