Skip to content

Commit

Permalink
Fix #51
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory PELLETEY committed Oct 7, 2016
1 parent 32eacbd commit 5919890
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/injector.js
Expand Up @@ -299,14 +299,14 @@ function getDefaultLineEnding(options, that, grunt) {
// when destination file is destFile
if (options.destFile) {
destination = options.destFile;
}

// if the destination file does not exist yet
// try to figure out lineEnding through src files
if (!grunt.file.exists(that.files[0].dest)) {
destination = that.filesSrc[0];
} else {
destination = that.files[0].dest;
//if the destination file does not exist yet
// try to figure out lineEnding through src files
if (!grunt.file.exists(that.files[0].dest)) {
destination = that.filesSrc[0];
} else {
destination = that.files[0].dest;
}
}

if (typeof destination === 'undefined') {
Expand All @@ -315,10 +315,10 @@ function getDefaultLineEnding(options, that, grunt) {
if (options.templateString) {
contents = options.templateString;
} else {
console.log(destination);
contents = String(grunt.file.read(destination));
}
}

return /\r\n/.test(contents) ? '\r\n' : '\n';
}

0 comments on commit 5919890

Please sign in to comment.