Skip to content

Commit

Permalink
Update replace.js
Browse files Browse the repository at this point in the history
Please accept these changes. During previous changes I didn't consider than the 'text field' already contains path of the file and also we need to check if text exists
  • Loading branch information
Dwarfess authored Jan 8, 2020
1 parent a42702c commit 8ac3a8c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,9 @@ module.exports = function(options) {
text = replacizeText(text, file);
if (canReplace && text !== null) {
fs.writeFileSync(file, text);
} else if (text) {
matched.push(text);
}

matched.push({
file,
text
});
}
else if (stats.isDirectory() && options.recursive) {
var files = fs.readdirSync(file);
Expand Down

0 comments on commit 8ac3a8c

Please sign in to comment.