Skip to content

Commit

Permalink
Added --canonicalroot option. semver-minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Jul 16, 2017
1 parent 1b2c80c commit 5f55fa4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions bin/hyperlink
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ var optimist = require('optimist'),
type: 'string',
demand: false
})
// .options('canonicalurl', {
// describe: 'URI root where the project being built will be deployed.',
// type: 'string',
// demand: false
// })
.options('canonicalroot', {
describe: 'URI root where the project being built will be deployed. Canonical URLs in local sources will be resolved to local URLs',
type: 'string',
demand: false
})
.options('verbose', {
alias: 'v',
describe: 'Log all added assets and relations. VERY verbose.',
Expand Down Expand Up @@ -53,7 +53,7 @@ if (commandLineOptions.h) {
}

var urlTools = require('urltools'),
// canonicalUrl = commandLineOptions.canonicalurl && urlTools.ensureTrailingSlash(commandLineOptions.canonicalurl),
canonicalRoot = commandLineOptions.canonicalroot && urlTools.ensureTrailingSlash(commandLineOptions.canonicalroot),
rootUrl = commandLineOptions.root && urlTools.urlOrFsPathToUrl(commandLineOptions.root, true),
excludePatterns = commandLineOptions.exclude && [].concat(commandLineOptions.exclude),
inputUrls;
Expand Down Expand Up @@ -81,6 +81,7 @@ if (commandLineOptions._.length > 0) {

hyperlink({
root: rootUrl,
canonicalRoot: canonicalRoot,
inputUrls: inputUrls,
excludePatterns: excludePatterns,
recursive: commandLineOptions.recursive,
Expand Down
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module.exports = function (options) {

var errorCount = 0;
var ag = new AssetGraph({
root: options.root
root: options.root,
canonicalRoot: options.canonicalRoot
});

var excludePattern;
Expand Down

0 comments on commit 5f55fa4

Please sign in to comment.