Skip to content

Commit c4ee8eb

Browse files
committed
chore(): rename variables to create a consistent usage of IonicAppLib across the codebase.
1 parent 78f0cb1 commit c4ee8eb

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

lib/cli.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var fs = require('fs');
1313
var settings = require('../package.json');
1414
var Tasks = require('./config/commands').allCommands;
1515
var orderedListOfTasks = require('./config/commands').orderedListOfCommands;
16-
var Utils = IonicAppLib.utils;
16+
var appLibUtils = IonicAppLib.utils;
1717
var Logging = IonicAppLib.logging;
1818
var log = Logging.logger;
1919
var Q = require('q');
@@ -144,7 +144,7 @@ Cli.run = function run(processArgv) {
144144
return Q.fcall(task.run.bind(task), Cli, argv, rawCliArguments);
145145
}
146146

147-
var root = Utils.cdIonicRoot();
147+
var root = appLibUtils.cdIonicRoot();
148148
var project = IonicProject.load(root);
149149
argv.v2 = project && project.get('v2');
150150

@@ -190,7 +190,7 @@ Cli.run = function run(processArgv) {
190190
return Cli.runWithGulp(argv, task, rawCliArguments);
191191

192192
} catch (ex) {
193-
return Utils.fail(ex);
193+
return appLibUtils.fail(ex);
194194
}
195195
};
196196

@@ -521,7 +521,7 @@ Cli.printNewsUpdates = function printNewsUpdates(skipNewsCheck) {
521521
log.info('+---------------------------------------------------------+\n'.green);
522522
} catch (ex) {
523523
q.reject('Error occurred in downloading the CLI messages:', ex);
524-
Utils.fail(ex);
524+
appLibUtils.fail(ex);
525525
}
526526
q.resolve(messagesJson);
527527
} else {
@@ -542,14 +542,14 @@ Cli.gatherInfo = function gatherInfo() {
542542
Cli.handleUncaughtExceptions = function handleUncaughtExceptions(err) {
543543
log.error('An uncaught exception occurred and has been reported to Ionic'.red.bold);
544544
var errorMessage = typeof err === 'string' ? err : err.message;
545-
Utils.errorHandler(errorMessage);
545+
appLibUtils.errorHandler(errorMessage);
546546
process.exit(1);
547547
};
548548

549549
Cli.attachErrorHandling = function attachErrorHandling() {
550-
Utils.errorHandler = function errorHandler(msg) {
550+
appLibUtils.errorHandler = function errorHandler(msg) {
551551
try {
552-
log.debug('Cli.Utils.errorHandler msg', msg, typeof msg);
552+
log.debug('Cli.appLibUtils.errorHandler msg', msg, typeof msg);
553553
var stack = typeof msg == 'string' ? '' : msg.stack;
554554
var errorMessage = typeof msg == 'string' ? msg : msg.message;
555555
if (msg) {
@@ -578,11 +578,11 @@ Cli.attachErrorHandling = function attachErrorHandling() {
578578
// Backwards compatability for those commands that havent been
579579
// converted yet.
580580
Cli.fail = function fail(err, taskHelp) {
581-
Utils.fail(err, taskHelp);
581+
appLibUtils.fail(err, taskHelp);
582582
};
583583

584584
Cli.getContentSrc = function getContentSrc() {
585-
return Utils.getContentSrc(process.cwd());
585+
return appLibUtils.getContentSrc(process.cwd());
586586
};
587587

588588
Cli.doRuntimeCheck = function doRuntimeCheck(version) {

lib/ionic/address.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var extend = Object.assign || require('util')._extend; // eslint-disable-line no-underscore-dangle
44
var IonicAppLib = require('ionic-app-lib');
5+
var IonicConfig = IonicAppLib.config;
56
var Serve = IonicAppLib.serve;
67

78
var settings = {
@@ -13,9 +14,9 @@ var settings = {
1314
function run(ionic, argv) { // eslint-disable-line no-unused-vars
1415

1516
// reset any address configs
16-
var ionicConfig = IonicAppLib.config.load();
17-
ionicConfig.set('ionicServeAddress', null);
18-
ionicConfig.set('platformServeAddress', null);
17+
var ionConfig = IonicConfig.load();
18+
ionConfig.set('ionicServeAddress', null);
19+
ionConfig.set('platformServeAddress', null);
1920
return Serve.getAddress({ isAddressCmd: true });
2021
}
2122

lib/ionic/lib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var unzip = require('unzip');
1111
var argv = require('optimist').argv;
1212
var prompt = require('prompt');
1313
var IonicAppLib = require('ionic-app-lib');
14-
var utils = IonicAppLib.utils;
14+
var appLibUtils = IonicAppLib.utils;
1515
var log = IonicAppLib.logging.logger;
1616
var exec = require('child_process').exec;
1717
var Q = require('q');
@@ -33,7 +33,7 @@ var settings = {
3333
function run(ionic, argv) {
3434

3535
if (!fs.existsSync(path.resolve('www'))) {
36-
return utils.fail('"www" directory cannot be found. Make sure the working directory ' +
36+
return appLibUtils.fail('"www" directory cannot be found. Make sure the working directory ' +
3737
'is at the top level of an Ionic project.', 'lib');
3838
}
3939

0 commit comments

Comments
 (0)