Skip to content

Commit

Permalink
Merge pull request #2 from papandreou/fix/extraFilesInOutput
Browse files Browse the repository at this point in the history
Fix extra files in output
  • Loading branch information
Munter authored Nov 14, 2017
2 parents ccde4c9 + 02e180a commit 39248b7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/subfont
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var commandLineOptions = optimist
.options('h', {
alias: 'help',
describe: 'Show this help',
type: 'boolean',
type: 'boolean',
default: false
})
.options('root', {
Expand Down Expand Up @@ -128,10 +128,11 @@ var assetGraphConfig = {
};

if (rootUrl.indexOf('file:') === -1) {
assetGraphConfig.canonicalRoot = rootUrl + '/';
assetGraphConfig.canonicalRoot = rootUrl.replace(/\/?$/, '/'); // Ensure trailing slash
}

new AssetGraph({ root: rootUrl })
var assetGraph = new AssetGraph(assetGraphConfig);
assetGraph
.logEvents()
.loadAssets(inputUrls)
.populate({
Expand Down Expand Up @@ -166,7 +167,7 @@ new AssetGraph({ root: rootUrl })
})
.endif()

.writeAssetsToDisc({ isLoaded: true }, outRoot, rootUrl)
.writeAssetsToDisc({ isLoaded: true, url: AssetGraph.query.createPrefixMatcher(assetGraph.root) }, outRoot, assetGraph.root)
.run(function (assetGraph) {
console.log('Output written to', outRoot);
});

0 comments on commit 39248b7

Please sign in to comment.