gulp-prompt
gulp-prompt copied to clipboard
Netbeans output window
Strange behaviour in Netbeans output window: The input line for the answer appears first. After entering the anwser, the question of the prompt appears as second line. But the order should actually be reversed. In Powershell the order of the two lines is correct (first the question, second the input).
Here an example of the Netbeans output window:
"C:\Users\John Doe\AppData\Roaming\npm\gulp.cmd" "update:fetchFromGit" "--color" [07:16:17] Using gulpfile C:\dev\gulpfile.js [07:16:17] Starting 'update:fetchFromGit'... 1.0.0 ? From which last commit or tag would you like to checkout? 1.0.0 [07:16:26] Finished 'update:fetchFromGit' after 8.6 s Done.
And here the gulp task.
gulp.task('update:fetchFromGit', function () {
var tag = '';
return gulp
.src('./install', {read: false})
.pipe(prompt.prompt({
type: 'input',
name: 'tag',
message: 'From which last commit or tag would you like to checkout?'
}, function (res) {
tag = res.tag;
}))
.pipe(run('git checkout-index -f --prefix="<%= file.path %>/" $(git diff --name-only ' + tag + ')', {
usePowerShell: true,
verbosity: 0
}));
});
@rjgamer Is this issue only on Windows? Does it only happen in netbeans? If you use the command line does it happen? I currently have access to a Mac so it is difficult to reproduce. I am jut trying to narrow down what the environment I need to find to reproduce this.
The issue happens on Windows 10 x64 in Netbeans 8.2, running with Java 8 (jdk1.8.0_101).
I've separated the prompt und Git fetching to separate tasks, but got the similar problem that the question is displayed after I've entered the anwser. Here is my current prompt task:
// Last commit or tag
var tag = '';
// Show prompt to get last commit or tag for checkout
gulp.task('update:_getTagForGit', function () {
return gulp
.src('./temp/update/install')
.pipe(prompt.prompt({
type: 'input',
name: 'tag',
message: 'From which last commit or tag would you like to checkout?'
}, function (res) {
tag = res.tag;
}));
});
Just a question to confirm. If you run this gulp taks from the command line (i.e. on your Windows 10 computer and not in Netbeans) does it work?
Correct. The prompt is working correctly from the PowerShell and command line tool.
Could you reproduce my "problem"?
@rjgamer I haven't had a chance to get a windows machine. It seems to be a problem on netbeans console because gulp-prompt seems to work fine on Mac, Linux and Windows. You can maybe try verifying the node version to see if there is something weird going on there.