Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

add environment variable for resources #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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';
}

Expand Down
3 changes: 2 additions & 1 deletion lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions lib/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
};
Expand Down