You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.
The command line moves on the instant that I press any key. It doesn't wait for me to finish typing my name and hit enter. Is there something I am missing here?
import { Command, flags } from '@oclif/command';
import chalk from 'chalk';
import { meow } from '../flags';
import cli from 'cli-ux';
export default class Hello extends Command {
static description = 'describe the command here';
static flags = {
help: flags.help({ char: 'h' }),
// flag with a value (-n, --name=VALUE)
name: flags.string({ char: 'n', description: 'name to print' }),
// flag with no value (-f, --force)
force: flags.boolean({ char: 'f' }),
meow: meow,
};
static args = [{ name: 'file' }];
async run() {
const yourName = await cli.prompt('What is your name?');
console.log(`your name is ${yourName}`);
const { args, flags } = this.parse(Hello);
if (flags.meow) console.log('MEOW');
const name = flags.name || 'WORLD';
this.log(chalk.bgCyan.bold(`\nHELLO ${name}!\n`));
}
}
The text was updated successfully, but these errors were encountered:
jemilox
changed the title
cli.promt(
cli.promt('my question'); is instantly moving on when the user presses any key
Aug 2, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using Oclif default hello world.
The command line moves on the instant that I press any key. It doesn't wait for me to finish typing my name and hit enter. Is there something I am missing here?
The text was updated successfully, but these errors were encountered: