diff --git a/lib/browser.js b/lib/browser.js index 00c09e2..feda446 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -146,7 +146,8 @@ Browser.downloadCordovaCrosswalkEngine = function downloadCordovaCrosswalkEngine return q.promise; } - var downloadUrl = ['https://github.com/driftyco/cordova-crosswalk-engine/archive/', crosswalkEngineVersion, '.zip'].join(''); + var site = process.env.IONIC_RESOURCE_SITE || 'https://github.com/driftyco/'; + var downloadUrl = [site, 'cordova-crosswalk-engine/archive/', crosswalkEngineVersion, '.zip'].join(''); var tempZipFilePath = path.join(appDirectory, 'engine', 'cordova-crosswalk-engine.zip'); var zipOutPath = path.join(appDirectory, 'engine'); @@ -267,7 +268,8 @@ Browser.downloadCordova40x = function downloadCordova40x(appDirectory) { var q = Q.defer(); var crosswalkEngineUnzipName = ['cordova-android-', cordovaAndroidVersion].join(''); - var downloadUrl = ['https://github.com/driftyco/cordova-android/archive/', cordovaAndroidVersion, '.zip'].join(''); + var site = process.env.IONIC_RESOURCE_SITE || 'https://github.com/driftyco/'; + var downloadUrl = [site, 'cordova-android/archive/', cordovaAndroidVersion, '.zip'].join(''); var tempZipFilePath = path.join(appDirectory, 'engine'); var cordovaAndroid4Path = path.join(tempZipFilePath, crosswalkEngineUnzipName, 'bin'); @@ -451,7 +453,7 @@ Browser.installCrosswalk = function installCrosswalk(appDirectory, version, save return Q(cordovaMessage); } else if (semver.satisfies(info.cordova, '>=5.0.0')) { return Browser.installCordovaCrosswalk(appDirectory); - } + } logging.logger.info(('You are running Cordova CLI ' + info.cordova + ' - installing Cordova Android and Crosswalk manually').yellow.bold); @@ -570,7 +572,7 @@ Browser.saveBrowserInstallation = function saveBrowserInstallation(platform, bro Browser.addBrowser = function addBrowser(appDirectory, browserToInstall, saveToPackageJson) { - if (!appDirectory) { + if (!appDirectory) { throw 'You must pass a directory to run this command'; } diff --git a/lib/resources.js b/lib/resources.js index a965702..7836b82 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -910,7 +910,8 @@ function copyIconFilesIntoResources(appDirectory, forceAddResources) { return Q(); } - var ionicResourcesUrl = 'https://github.com/driftyco/ionic-default-resources/archive/master.zip'; + var site = process.env.IONIC_RESOURCE_SITE || 'https://github.com/driftyco/'; + var ionicResourcesUrl = site + 'ionic-default-resources/archive/master.zip'; logging.logger.debug('uzip to: ', unzipPath) logging.logger.info('Downloading Default Ionic Resources'.yellow); return Utils.fetchArchive(unzipPath, ionicResourcesUrl) diff --git a/lib/start.js b/lib/start.js index 75901df..07beef8 100644 --- a/lib/start.js +++ b/lib/start.js @@ -135,7 +135,8 @@ Start.fetchWrapper = function fetchWrapper(options) { var q = Q.defer(); // var self = this; - var repoUrl = 'https://github.com/driftyco/' + WRAPPER_REPO_NAME + '/archive/master.zip'; + var site = process.env.IONIC_RESOURCE_SITE || 'https://github.com/driftyco/'; + var repoUrl = site + WRAPPER_REPO_NAME + '/archive/master.zip'; Utils.fetchArchive(options.targetPath, repoUrl) .then(function() { @@ -462,7 +463,8 @@ Start.fetchIonicStarter = function(options) { var repoName = ['ionic-starter-', options.template].join('') // Get the URL for the starter project repo: - var repoUrl = ['https://github.com/driftyco/', repoName].join('') + var site = process.env.IONIC_RESOURCE_SITE || 'https://github.com/driftyco/'; + var repoUrl = [site, repoName].join('') return Start.fetchGithubStarter(options, repoUrl); };