Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
util.checkUpdate(cliPackageConfig, (error, update) => {
if (!error) {
const { terminal } = require('@absolunet/terminal');
terminal.spacer();
if (update.current !== update.latest) {
util.echo(`Update available: ${chalk.dim(update.current)} ${chalk.reset('→')} ${chalk.green(update.latest)}\n\nUpdating...`);
} else {
util.echo('No update available\n\nReinstalling...');
}
terminal.spacer();
terminal.run('npm uninstall -g @absolunet/nwayo-cli && npm install -g --no-audit @absolunet/nwayo-cli');
} else {
util.exit(error);
}
});
const npmInstall = () => {
const fss = require('@absolunet/fss');
const { terminal } = require('@absolunet/terminal');
fss.remove(nodeModules);
fss.remove(`${root}/package-lock.json`);
terminal.run(`cd ${root} && npm install --no-audit`);
util.exit();
};
const vendorInstall = () => {
terminal.print(`
Installing vendors via npm
`);
fss.remove(paths.directory.vendorsDependencies);
fss.remove(`${paths.directory.vendors}/package-lock.json`);
terminal.run(`cd ${paths.directory.vendors} && npm install --no-audit`);
};