Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Replace all occurrences when replacing, not just the first #8

Merged
merged 1 commit into from
May 9, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/hashresHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ exports.hashAndSub = function(grunt, options) {
var destContents = fs.readFileSync(f, encoding);
for (var name in nameToHashedName) {
grunt.log.debug('Substituting ' + name + ' by ' + nameToHashedName[name]);
destContents = destContents.replace(name, nameToHashedName[name]);
destContents = destContents.replace(new RegExp(name, "g"), nameToHashedName[name]);
}
grunt.log.debug('Saving the updated contents of the outination file');
fs.writeFileSync(f, destContents, encoding);
Expand Down