Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[api][doc] updated jitsu.comands.env.load function to utilize optiona…

…l appname and filename in that order\n also updated self documenting feature to reflect this
  • Loading branch information...
commit 2b1ccf958e048a1ca22a8cc5b42314337d16bd49 1 parent 5aecfdc
@blakmatrix blakmatrix authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 lib/jitsu/commands/env.js
View
23 lib/jitsu/commands/env.js
@@ -328,8 +328,13 @@ env.load = function (appName, file, callback) {
if(arguments.length) {
var args = utile.args(arguments);
callback = args.callback;
- file = args[0] || 'env.json';
- appName = args[1] || null;
+ appName = args[0] || null;
+ file = args[1] || 'env.json';
+ if (appName === null){
+ viewApp(callback, executeLoad);
+ } else{
+ viewAppByName(appName, function(){jitsu.commands.env.load(null, appName, callback);}, executeLoad);
+ }
}
function executeLoad(err, app) {
@@ -345,7 +350,7 @@ env.load = function (appName, file, callback) {
env = JSON.parse(data);
}
catch (err) {
- jitsu.log.error('Error parsing ' + file);
+ jitsu.log.error('Error parsing ' + file.yellow);
return callback(err);
}
@@ -371,13 +376,6 @@ env.load = function (appName, file, callback) {
});
});
}
-
- if (!appName) {
- viewApp(callback, executeLoad);
- }
- else {
- viewAppByName(appName, callback, executeLoad);
- }
};
//
@@ -389,8 +387,9 @@ env.load.usage = [
'for use with `jitsu env save`. See `jitsu help env save` for more info.',
'',
'jitsu env load',
- 'jitsu env load <file>',
- 'jitsu env load <file> <app>',
+ 'jitsu env load [<app>]',
+ 'jitsu env load [<file>]',
+ 'jitsu env load [<app>] [<file>]',
];
//
Please sign in to comment.
Something went wrong with that request. Please try again.