Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
args = args || [];
if (typeof args === 'boolean') {
authRequired = args;
args = [];
}
if (typeof args.length !== 'number') args = [];
Modulus.io.print('Welcome to ' + 'Modulus'.magenta);
Diff = Diff({
packagePath: Path.resolve(__dirname, '..', 'package.json')
}).update;
if (Diff) {
Modulus.io.warning('Your version ' + Diff.current.verbose + ' is behind the latest release ' + Diff.latest.verbose + '.');
Modulus.io.print('Please update using "npm update -g Modulus"');
}
function go() {
args.push(done);
command.apply(Modulus, args);
}
if (authRequired) {
Modulus.commands.user.isAuthenticated(function (err, result) {
if (err) Modulus.io.error(err);
if (result) go();
else {
Modulus.io.error('Need to be logged in to execute this command.');
Modulus.io.print('Please log in with "Modulus login" command.');
return done();