From 9d2813a44f15c55146b27780f8b004a7a5a22aca Mon Sep 17 00:00:00 2001 From: Mike Lambert Date: Wed, 30 Aug 2017 17:12:26 -0600 Subject: [PATCH] Use url concatenation instead of path concatenation. Otherwise a 'path' of 'https://mycdndomain.com/' gets path.join-ed to become 'https:/mycdndomain.com', which breaks everything. --- helpers-es5.js | 3 ++- helpers.js | 3 ++- package.json | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/helpers-es5.js b/helpers-es5.js index 35c273c5..11e07f4a 100644 --- a/helpers-es5.js +++ b/helpers-es5.js @@ -16,6 +16,7 @@ var path = require('path'), mkdirp = require('mkdirp'), Jimp = require('jimp'), svg2png = require('svg2png'), + url = require('url'), File = require('vinyl'), Reflect = require('harmony-reflect'), NRC = require('node-rest-client').Client, @@ -46,7 +47,7 @@ var path = require('path'), } function relative(directory) { - return path.join(options.path, directory).replace(/\\/g, '/'); + return url.resolve(options.path, directory).replace(/\\/g, '/'); } function print(context, message) { diff --git a/helpers.js b/helpers.js index 9dd0c19d..0a0f2536 100644 --- a/helpers.js +++ b/helpers.js @@ -12,6 +12,7 @@ const path = require('path'), mkdirp = require('mkdirp'), Jimp = require('jimp'), svg2png = require('svg2png'), + url = require('url'), File = require('vinyl'), Reflect = require('harmony-reflect'), NRC = require('node-rest-client').Client, @@ -42,7 +43,7 @@ const path = require('path'), } function relative (directory) { - return path.join(options.path, directory).replace(/\\/g, '/'); + return url.resolve(options.path, directory).replace(/\\/g, '/'); } function print (context, message) { diff --git a/package.json b/package.json index 1b6334b7..59387c85 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "tinycolor2": "^1.1.2", "to-ico": "^1.1.2", "underscore": "^1.8.3", + "url": "^0.11.0", "vinyl": "^1.1.0" }, "devDependencies": {