Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
npm.load(npmConfig, function(err) {
if(err) {
process.chdir(originCwd);
return callback(new Error('Npm config failed' + err));
}
npm.commands.install([ ], function(err, data) {
logger.debug(data);
if (err) {
process.chdir(originCwd);
return callback(new Error('Npm install failed' + err));
} else {
process.chdir(originCwd);
return callback(null);
}
});
// Doesn't seem to ouput something
/*
npm.logger.on('log', function(message) {
logger.info('mermem');
logger.info(message);
});
_npm.load({ exit: false }, function (err) {
// TODO: how to add flags such as --force ?
_npm.commands.publish([path], function (err, result) {
callback(err, result);
});
});
}
npm.load(conf, function loadnpm(err) {
if (err) return fn(err);
// make sure the packages are installed in the square node_modules folder
// instead of the current directory where the square command is executed
npm.commands.install(directory, [packages + '@' + version], function install(err) {
if (err) return fn(err);
fn(null, require(location));
});
});
};
npm.registry.adduser(process.env.NPM_USERNAME, process.env.NPM_PASSWORD, process.env.NPM_EMAIL, function(err) {
if (err) {
console.log(err);
return done(err);
}
npm.config.set("email", process.env.NPM_EMAIL, "user");
npm.commands.publish([paths.dist], function(err) {
if (err) {
console.log(err);
return done(err);
}
console.log(paths.dist + " v" + pkg.verison + " Published to registry");
return done();
});
});
}, function (err) {
if (err) {
throw err;
}
npm.commands.run(['configure', 'build'], err => {
if (err) {
throw err;
}
});
npm.on("log", function (message) {
console.log(message);
});
});
}
npm.load({"-s":"true", "s": "true", "-silent":"true", "silient":"true"}, function (er) {
if (er) return handlError(er)
npm.commands.install(["vows", "eyes"], function (er, data) {
if (er) return console.log("There was an error:", er);
console.log("Just installed the programs");
})
})
.then(function() {
return Q.ninvoke(npm.commands, 'config', args);
});
},
npm.load(function () {
npm.commands.publish(['.'], function (e) {
if (e) {
grunt.log.errorln(e);
done(false);
} else {
grunt.log.writeln('Publish success');
done();
}
})
})
function installAllDeps () {
const install = Bluebird.promisify(npm.commands.install)
return install([])
}