Skip to content

Commit

Permalink
still allow use of colon in comments but convert them for generated f…
Browse files Browse the repository at this point in the history
…iles

fixes chrislopresto#72
  • Loading branch information
Uli Morgner committed Jun 30, 2016
1 parent 16d9189 commit 53264f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions freestyle-usage-snippet-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function extractHbsComponentSnippets(fileContent, componentName, ui) {
ui.writeLine('ember-freestyle detected multiple instances of the freestyle-note slug "' + name +'"');
}
} else {
if (output[name + '_usage']) {
if (output[name + ':usage']) {
ui.writeLine('ember-freestyle detected multiple instances of the freestyle-usage slug "' + name +'"');
}
name += '_usage';
name += ':usage';
}
}
}
Expand Down Expand Up @@ -117,6 +117,7 @@ SnippetFinder.prototype.write = function (readTree, destDir) {
var commentSnippets = extractCommentSnippets(fs.readFileSync(filename, 'utf-8'));
var snippets = naiveMerge(componentSnippets, commentSnippets);
for (var name in snippets){
var filename = name.replace(":notes", "_notes").replace(":usage", "_usage"); // replace : in order to have windows friendly filenames
fs.writeFileSync(path.join(destDir, name)+path.extname(filename),
snippets[name]);
}
Expand Down

0 comments on commit 53264f2

Please sign in to comment.