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

Issue when src and dest is the same path #24

Merged
merged 1 commit into from
Jan 13, 2014
Merged

Issue when src and dest is the same path #24

merged 1 commit into from
Jan 13, 2014

Conversation

tschaub
Copy link
Owner

@tschaub tschaub commented Jan 13, 2014

Hi, thanks for your great plugin, it very helpful!

I notice small issue: it seems to doesn't work when task configured the way when source and destination is the same file.

Example:

concat: {
  banner: {
    options: {
      banner: "some banner ..."
    },
    expand: true,
    flatten: false,
    cwd: 'dist',
    src: '*.js',
    dest: 'dist'
  }
}

I use grunt-contrib-concat to add banners (I know it not very smart, but works). When I try to run concat task, configured like this, through newer it always handle zero files.

P.S.
Sory for my bad english.

@eirikhm
Copy link

eirikhm commented Jan 7, 2014

I can confirm this. It cannot find any "newer files" when I'm using this with grunt-typescript, but as soon as I change dst everything works as it should.

@tschaub
Copy link
Owner

tschaub commented Jan 7, 2014

This is a known limitation. It is not possible for source files to be newer than destination files when the source and destination are the same file. An alternative to processing files in place is to have each task produce a new set of files. Hope that makes sense.

@tschaub tschaub closed this Jan 7, 2014
@russelldavis
Copy link

@tschaub Couldn't you address this by treating these tasks (where src and dest are the same) like tasks that don't have a dest at all, i.e., compare to the timestamp of when the task was last run?

@tschaub
Copy link
Owner

tschaub commented Jan 7, 2014

Indeed @russelldavis

@tschaub tschaub reopened this Jan 7, 2014
@tschaub
Copy link
Owner

tschaub commented Jan 13, 2014

@pozadi I think 3e49f48 should address your issue. If you're able to test out the same branch, let me know if this works as expected.

@rpominov
Copy link
Author

Yes, it works great. Thank you.

@rpominov rpominov closed this Jan 13, 2014
@rpominov rpominov reopened this Jan 13, 2014
@rpominov
Copy link
Author

Sorry for closing, didn't realize that it is PR now :)

tschaub added a commit that referenced this pull request Jan 13, 2014
Issue when src and dest is the same path.
@tschaub tschaub merged commit cb651a2 into master Jan 13, 2014
@tschaub tschaub deleted the same branch January 13, 2014 17:02
@tschaub
Copy link
Owner

tschaub commented Jan 13, 2014

Thanks for testing @pozadi (and thanks for the good suggestion @russelldavis).

Published as [email protected].

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

Successfully merging this pull request may close these issues.

4 participants