Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Since `:` is illigal on windows adding --encode option to encode `:` …

…into `%3A`.
  • Loading branch information...
commit 8d34984b1db950ab188339b150e06ed6b952284f 1 parent 19bbc86
@Gozala authored
Showing with 17 additions and 4 deletions.
  1. +8 −0 bin/graphquire.js
  2. +5 −2 graphquire.js
  3. +4 −2 utils/deployment.js
View
8 bin/graphquire.js
@@ -23,6 +23,13 @@ function cachePath() {
var index = params.indexOf('--cache-path')
return ~index ? params[++index] : './node_modules'
}
+
+function isEscape() {
+ return params.some(function onEach(param) {
+ return param === '-e' || param === '--escape'
+ })
+}
+
function isWriting() {
return params.some(function onEach(param) {
return param === '-w' || param === '--write'
@@ -81,6 +88,7 @@ var options = {
cachePath: cachePath(),
location: getLocation(),
includeSource: !isNoSource(),
+ escape: isEscape()
}
graphquire.getGraph(options, function onGraph(error, graph) {
View
7 graphquire.js
@@ -163,10 +163,13 @@ function getGraph(options, onComplete, onProgress) {
uri: isURI(location) ? location : './',
cachePath: options.cachePath || './',
includesSource: options.includeSource || false,
+ escape: options.escape || false,
resolvePath: function resolvePath(id) {
var root = path.dirname(graph.path)
- return isURI(id) ? path.join(root, graph.cachePath, id) :
- isRelative(id) ? path.join(root, id) : null
+ return isURI(id) ?
+ path.join(root, graph.cachePath,
+ graph.escape ? id.replace(/:/, encodeURIComponent) : id)
+ : isRelative(id) ? path.join(root, id) : null
},
resolveURI: function resolveURI(id) {
return isURI(id) ? id : isRelative(id) ? resolve(id, graph.uri) : null
View
6 utils/deployment.js
@@ -18,8 +18,10 @@ var WROTE_MODULE = exports.WROTE_MODULE = 10
function clean(graph, onComplete, onProgress) {
var modules = graph.modules
var root = path.dirname(graph.path)
- var http = path.join(root, graph.cachePath, 'http!')
- var https = path.join(root, graph.cachePath, 'https!')
+ var http = path.join(root, graph.cachePath,
+ graph.escape ? encodeURIComponent('http:') : 'http:')
+ var https = path.join(root, graph.cachePath,
+ graph.escape ? encodeURIComponent('https:') : 'https:')
var paths = Object.keys(modules).map(graph.resolvePath.bind(graph))
.map(path.join.bind(path, root))
Please sign in to comment.
Something went wrong with that request. Please try again.