How to use the @absolunet/terminal.dontSudoMe function in @absolunet/terminal

To help you get started, we’ve selected a few @absolunet/terminal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github absolunet / nwayo / workflow / cli.js View on Github external
module.exports = ({ cliPkg, cliPath, workflowInstaller }) => {

	//-- Initialize
	util.initCli();

	//-- Don't you dare sudo me
	if (cli.isRoot()) {
		terminal.dontSudoMe();

	//-- Initialize CLI
	} else {

		util.workflowInstaller = workflowInstaller;

		const cliBin      = `     cli${chalk.yellow('@')}${cliPkg.version} ${cliPath}`;
		const workflowBin = `workflow${chalk.yellow('@')}${env.workflowPkg.version} ${paths.workflow.root}`;

		cli.tasksRouter(meow({
			pkg:         cliPkg,
			description: `${env.logo}  ${env.workflowPkg.definition}`,
			help:        `${cli.fullUsage}\n${cliBin}\n${workflowBin}`
		}));
	}