Пример #1
0
    Conflicter.prototype.collision = function (file, cb) {
      var rfilepath = path.relative(process.cwd(), file.path)
      if (!pathExists.sync(file.path)) {
        this.adapter.log.create(rfilepath)
        cb('create')
        return
      }
      else if (/index.js$/.test(file.path)) {
        this.adapter.log.force(rfilepath)
        cb('force')
        return
      }

      if (this.force) {
        this.adapter.log.force(rfilepath)
        cb('force')
        return
      }
      if (detectConflict(file.path, file.contents)) {
        this.adapter.log.conflict(rfilepath)
        this._ask(file, cb)
      } else {
        this.adapter.log.identical(rfilepath)
        cb('identical')
      }
    }
Пример #2
0
Conflicter.prototype.collision = function (file, cb) {
  var rfilepath = path.relative(process.cwd(), file.path);

  if (!fs.existsSync(file.path)) {
    this.adapter.log.create(rfilepath);
    return cb('create');
  }

  if (this.force) {
    this.adapter.log.force(rfilepath);
    return cb('force');
  }

  if (detectConflict(file.path, file.contents)) {
    this.adapter.log.conflict(rfilepath);
    return this._ask(file, cb);
  } else {
    this.adapter.log.identical(rfilepath);
    return cb('identical');
  }
};