How to use the @absolunet/terminal.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 / packages / workflow / cli.js View on Github external
module.exports = ({ cliPkg, cliPath, cliUsage }) => {

	//-- Initialize
	util.initCli(cliUsage);

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

	//-- Initialize CLI
	} else {

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

		cli.tasksRouter(meow({
			pkg:         cliPkg,  // eslint-disable-line unicorn/prevent-abbreviations
			description: `${env.logo}  ${env.workflowConfig.definition}`,
			help:        `${cli.fullUsage}\n${cliBin}\n${workflowBin}`
		}));
	}

};