Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echo hangs and loops infinitely #30

Closed
tpizza opened this issue Nov 18, 2016 · 3 comments
Closed

Echo hangs and loops infinitely #30

tpizza opened this issue Nov 18, 2016 · 3 comments

Comments

@tpizza
Copy link

tpizza commented Nov 18, 2016

If I echo out to a file, the command runs, but it loops infinitely and recursively writes to the target file.

Here's my use-case as to why I'm even performing an echo:

I really enjoy the safeguard in password protecting my SSH key. Not so much for the extra 'security', but it gives me a brief moment to decide if there's something I forgot and back out of a push. I'm in the process of automating an upstream setup using Gulp where I need to use a password-less key to handle the subtree setup. The point of the echo is to write to the SSH config to change the key to the p/w-less one for setting, pulling and merging the subtree, then restoring it once the process completes.

This is all you need to reproduce:

GULP.task('_homez', () => { return GULP.src('./**/**') .pipe( PLUGINS.exec('echo test > test.txt') ) .pipe( PLUGINS.exec.reporter()); } );

@robrich
Copy link
Owner

robrich commented Nov 18, 2016

./**/** grabs everything including node_modules. It ran fine for me,
but took a long time. Switch to echo test >> test.txt to see how many
times it ran. Add a !./node_modules/**/** glob or otherwise limit the
input file list so it'll do less work.

On Nov 17, 2016 5:07 PM, "Theo P." notifications@github.com wrote:

If I echo out to a file, the command runs, but it loops infinitely and
recursively writes to the target file.

Here's my use-case as to why I'm even performing an echo:

I really enjoy the safeguard in password protecting my SSH key. Not so
much for the extra 'security', but it gives me a brief moment to decide if
there's something I forgot and back out of a push. I'm in the process of
automating an upstream setup using Gulp where I need to use a password-less
key to handle the subtree setup. The point of the echo is to write to the
SSH config to change the key to the p/w-less one for setting, pulling and
merging the subtree, then restoring it once the process completes.

This is all you need to reproduce:

GULP.task('_homez', () => { return GULP.src('.//') .pipe(
PLUGINS.exec('echo test > test.txt') ) .pipe( PLUGINS.exec.reporter()); } );


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#30, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAolfG155be6k5YshXHodz_tJOJtUl1sks5q_OvZgaJpZM4K1-CB
.

@tpizza
Copy link
Author

tpizza commented Nov 18, 2016

Interesting. When I switched the command to append the echoes, I got to about 8 tests until I killed the task. For a second I thought maybe it was because the task was trying to also run through the IntelliJ project folder, but it would still hang even with !./.idea/**/**. I got it working, however instead of the wildcard glob, I passed src the project root ./ and the task would successfully finish.

@robrich
Copy link
Owner

robrich commented Nov 18, 2016

Glad you got it solved. I wonder if the shell was waiting to read a locked file.

@robrich robrich closed this as completed Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants