Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Mar 7, 2018
1 parent 1a9248f commit af689e1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions bin/subfont
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,14 @@ var assetGraph = new AssetGraph(assetGraphConfig);
}

await assetGraph.moveAssets({ type: 'Html', isLoaded: true, isInline: false, fileName: { $or: ['', undefined] } }, function (asset, assetGraph) {
let nextSuffixToTry = 0;
let url;
do {
url = asset.url.replace(rootUrl, outRoot).replace(/\/?$/, '/') + 'index' + (nextSuffixToTry ? '-' + nextSuffixToTry : '') + asset.defaultExtension;
nextSuffixToTry += 1;
} while (assetGraph.findAssets({ url }).length > 0);

return url;
return asset.url.replace(/\/?$/, '/') + 'index' + asset.defaultExtension;
});
}

await assetGraph.writeAssetsToDisc({ isLoaded: true, url: url => url.startsWith(assetGraph.root) }, outRoot, assetGraph.root);
await assetGraph.writeAssetsToDisc({
isLoaded: true,
url: url => url.startsWith(assetGraph.root)
}, outRoot, assetGraph.root);

if (debug) {
console.log(require('util').inspect(fontInfo, false, 99));
Expand Down

0 comments on commit af689e1

Please sign in to comment.