diff --git a/lib/cmds/template_generator.js b/lib/cmds/template_generator.js index fec59941..a079aaa4 100644 --- a/lib/cmds/template_generator.js +++ b/lib/cmds/template_generator.js @@ -56,9 +56,6 @@ class TemplateGenerator { } getExternalProject(uri) { - const constants = require('../constants'); - const RAW_URL = 'https://github.com/'; - let match = uri.match( /\.[a-z]+\/([-a-zA-Z0-9@:%_+.~#?&\/=]+)/ ); @@ -66,17 +63,17 @@ class TemplateGenerator { let url, folder; if (uri.startsWith('http')) { - url = uri + "/archive/master.zip" - folder = match[1] + url = uri + "/archive/master.zip"; + folder = match[1]; } else if (uri.startsWith('github')) { - url = "https://" + uri + "/archive/master.zip" - folder = match[1] + url = "https://" + uri + "/archive/master.zip"; + folder = match[1]; } else if (uri.split('/').length === 2) { - url = "https://github.com/" + uri + "/archive/master.zip" - folder = uri + url = "https://github.com/" + uri + "/archive/master.zip"; + folder = uri; } else if (uri.indexOf('/') === -1) { - url = "https://github.com/embark-framework/embark-" + uri + "-template/archive/master.zip" - folder = "embark-framework/embark-" + uri + "-template" + url = "https://github.com/embark-framework/embark-" + uri + "-template/archive/master.zip"; + folder = "embark-framework/embark-" + uri + "-template"; } return { diff --git a/lib/utils/utils.js b/lib/utils/utils.js index c9d71010..e403727a 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -179,8 +179,7 @@ function extractTar(filename, packageDirectory, cb) { function extractZip(filename, packageDirectory, cb) { const decompress = require('decompress'); - decompress(filename, packageDirectory).then(files => { - console.log('done!'); + decompress(filename, packageDirectory).then((_files) => { cb(); }); }