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

Log which file changed with Gulp #151

Open
adammockor opened this issue Jan 14, 2015 · 10 comments
Open

Log which file changed with Gulp #151

adammockor opened this issue Jan 14, 2015 · 10 comments

Comments

@adammockor
Copy link

Is it possible to do that? I got task like below, but it logs all files in stream instead of only files, which changed.

//to jade
gulp.src('app/views/layouts/*.jade')
 .pipe(wiredep({
    exclude: ['bootstrap-sass-official', 'modernizr'],
    ignorePath: '../../',
    overides: {},
    onFileUpdated: function(file) {
      console.log(file);
    }
  }))
  .pipe(gulp.dest('app/views/layouts'));
@CWSpear
Copy link
Contributor

CWSpear commented Jan 14, 2015

Why would you expect only files that changed to trigger?

@adammockor
Copy link
Author

Because of the logging of the changes. Grunt-wiredep has this functionality.

@stephenplusplus
Copy link
Member

onFileUpdated is called for every file, even if it wasn't changed?

(please forgive my delay!)

@adammockor
Copy link
Author

In my experience yes. (please forgive my delay!)

@stephenplusplus
Copy link
Member

Oh man, we are full of delays. Sorry for this one, too :(

In non-stream mode, here's how we're detecting if we need to write new content :

if (contents !== newContents) {

Maybe we should do something similar for the stream mode:

config.get('on-file-updated')(filePath);

@stephenplusplus
Copy link
Member

PR welcome!

@CWSpear
Copy link
Contributor

CWSpear commented May 22, 2015

Can I just say: Thank you for linking to specific commits (tag would have been okay, too) and not master?

@stephenplusplus
Copy link
Member

:) So important to remember to do that, but I most often forget. For anyone who doesn't know already, select a line as normal, then press y to get a specific URL generated.

@CWSpear
Copy link
Contributor

CWSpear commented May 22, 2015

Whoa, I didn't know that trick! I always just navigated to the commit/tag. Very nice trick!

@eddiemonge eddiemonge added the bug label Mar 16, 2016
@eddiemonge
Copy link
Contributor

that sounds like a bug then since if a file wasn't updated then it shouldn't trigger that event

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

No branches or pull requests

4 participants