Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Prompt not blocking #65

Closed
pherris opened this Issue Apr 2, 2013 · 8 comments

Comments

Projects
None yet
4 participants

pherris commented Apr 2, 2013

on node v0.8.16 prompt is not blocking when using example code:

var prompt = require('prompt');

//
// Start the prompt
//
prompt.start();

//
// Get two properties from the user: username and email
//
prompt.get(['username', 'email'], function (err, result) {
//
// Log the results.
//
console.log('Command-line input received:');
console.log(' username: ' + result.username);
console.log(' email: ' + result.email);
});

edef1c commented Apr 18, 2013

Everything behaves correctly as far as I can tell.

 ~ ⮀ npm install prompt
.. npm spam ..
prompt@0.2.9 node_modules/prompt
├── revalidator@0.1.5
├── pkginfo@0.3.0
├── read@1.0.4 (mute-stream@0.0.3)
├── utile@0.1.7 (deep-equal@0.0.0, rimraf@1.0.9, async@0.1.22, ncp@0.2.7, mkdirp@0.3.5, i@0.3.1)
└── winston@0.6.2 (cycle@1.0.2, eyes@0.1.8, colors@0.6.0-1, stack-trace@0.0.6, pkginfo@0.2.3, async@0.1.22, request@2.9.203)
 ~ ⮀ cat > prompt.js
var prompt = require('prompt');

//
// Start the prompt
//
prompt.start();

//
// Get two properties from the user: username and email
//
prompt.get(['username', 'email'], function (err, result) {
//
// Log the results.
//
console.log('Command-line input received:');
console.log(' username: ' + result.username);
console.log(' email: ' + result.email);
});
 ~ ⮀ nave use 0.8.16 node prompt.js 
Already installed: 0.8.16
using 0.8.16
prompt: username:  blah
prompt: email:  bluh
Command-line input received:
 username: blah
 email: bluh
 ~ ⮀ 

@edef1c edef1c closed this Apr 18, 2013

getdave commented May 7, 2013

I'm having the same issue with the exact same code. I was hoping to use a prompt with a GruntJS "Multitask" but it just ignores the prompt completely and completes...

edef1c commented May 10, 2013

Are you doing this from an actual terminal?

getdave commented Jun 10, 2013

No actually I was hoping to include it within a GruntJS task. Will this not work? Much appreciated

edef1c commented Jun 12, 2013

I have no idea what kind of funky things GruntJS does, unfortunately :(

getdave commented Jun 12, 2013

@nathan7 that's ok. Doesn't seem to block execution in my task at the mo, but maybe I'll find a way.

Thanks again

@getdave did you figure out a way to incorporate prompt into a Grunt task?

getdave commented Jan 2, 2014

@stevenvachon No I didn't. I've decided that Yeoman is typically a better tool for creating tasks that require prompts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment