Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.1 KB

.verb.md

File metadata and controls

35 lines (24 loc) · 1.1 KB

Attribution

Some of the logic in this plugin, in particular lib/diffs.js, is based on the conflicter code in [yeoman-generator][], Copyright (c) 2015, Google, licensed under BSD-2-Clause.

Usage

The following code should work with any [base][] application, including [verb][], [assemble][], and [generate][].

var path = require('path');
var Base = require('base');
var fs = require('base-fs');
var conflicts = require('{%= name %}');
var base = new Base();

// register the `conflicts` and `fs` plugins
base.use(conflicts());
base.use(fs());

// pass the same `dest` to both `.dest()` and `.conflicts()`
var dest = 'fixtures/dist';

base.src('fixtures/*.txt')
  .pipe(base.conflicts(dest)) // adds a `.conflicts()` method
  .pipe(base.dest(dest));

Example

If a file conflict is detected, you'll see something like this in the terminal:

screen shot 2016-03-17 at 8 05 53 pm

API

{%= apidocs("index.js") %}