gulp-prompt icon indicating copy to clipboard operation
gulp-prompt copied to clipboard

Netbeans output window

Open jnessier opened this issue 6 years ago • 8 comments

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).

jnessier avatar Apr 04 '18 05:04 jnessier

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.

jnessier avatar Apr 04 '18 05:04 jnessier

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
            }));
});

jnessier avatar Apr 04 '18 05:04 jnessier

@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.

shannonlal avatar Apr 10 '18 00:04 shannonlal

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;
            }));
});

jnessier avatar Apr 10 '18 05:04 jnessier

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?

shannonlal avatar Apr 10 '18 10:04 shannonlal

Correct. The prompt is working correctly from the PowerShell and command line tool.

jnessier avatar Apr 10 '18 10:04 jnessier

Could you reproduce my "problem"?

jnessier avatar Apr 29 '18 12:04 jnessier

@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.

shannonlal avatar Jul 30 '18 00:07 shannonlal