slushjs / gulp-conflict

Check if files in stream conflict with those in target dir, with option to use new, keep old, show diff, etc.
MIT License
22 stars 12 forks source link

Missing documentation? #9

Open kokujin opened 8 years ago

kokujin commented 8 years ago

I tried this

.pipe( conflict( './', {
                    defaultChoice: 'd'
                } ) )

It failed. Can someone show some examples or point me to the docs that can show me how to deal with these issues? Thanks

vousk commented 8 years ago

I also can't manage to activate defaultChoice. I'm using it like this: conflict(my_path, { defaultChoice:'y' }) But it still asks me for manual input...

vousk commented 8 years ago

Ok I understood, with defaultChoice:'y', the system asks for pressing "enter" to confirm replacement, instead of asking what to do. But it would be usefull to have an other option applyDefaultChoice:'true' to launch the whole process without manual intervention.

benjaminapetersen commented 8 years ago

I'd like to see a bit more documentation here as well. I'm not 100% sure gulp-conflict does what I think it is intending to do via the README, I could be mistaken. For example:

gulp.src(['./files/*.js'])
  .pipe(conflict('./dir'))
  .pipe(gulp.dest('./dir'));

If I am checking gulp.src(['./files/*.js']) against ./dir via .pipe(conflict('./dir')), then why do I need to .pipe(gulp.dest('./dir')); at the end? It seems like the output is supposed to be conflict/no conflict. Is there conceptually something else going on here?

benjaminapetersen commented 8 years ago

ping! just checking if the repo is still alive.

joakimbeng commented 8 years ago

Yes, you're right that there is missing documentation. There are two more options replaceAll and skipAll both of which shouldn't require input from the user.

why do I need to .pipe(gulp.dest('./dir')); at the end?

Because this plugin does not touch the disk, it just filters the stream according to if existing files should be overwritten or not. Without it no write to disk would happen.

benjaminapetersen commented 8 years ago

So it can diff src files against whatever you do to the stream, but not against another directory of files, correct? Just to clarify, I think then my use case is not possible.

Thanks!

vousk commented 8 years ago

I've just tried "replaceAll", but instead of replacing only the conflicting files, it re-writes every files. Is it the expected behavior ? My need is simply to allow the script to answer "replace" for conflicting files, I do not want it to override every files.

jdnichollsc commented 8 years ago

What happen with the documentation? :-1:

tdmalone commented 6 years ago

Might need to check the source in lieu of documentation at the moment.

I was looking for a way to avoid verbose logging, based on this line it looks like we can define our own logging function to replace the default one. That'd be handy to have in the docs somewhere :)