tree-sync
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -53,2 +53,3 @@ 'use strict'; | ||
var pathname = patch[1]; | ||
var entry = patch[2]; | ||
@@ -60,5 +61,5 @@ var inputFullpath = this._input + '/' + pathname; | ||
case 'create' : | ||
return fs.writeFileSync(outputFullpath, fs.readFileSync(inputFullpath)); | ||
return fs.writeFileSync(outputFullpath, fs.readFileSync(inputFullpath), { mode: entry.mode }); | ||
case 'change' : | ||
return fs.writeFileSync(outputFullpath, fs.readFileSync(inputFullpath)); | ||
return fs.writeFileSync(outputFullpath, fs.readFileSync(inputFullpath), { mode: entry.mode }); | ||
case 'mkdir' : | ||
@@ -65,0 +66,0 @@ try { |
{ | ||
"name": "tree-sync", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "", | ||
@@ -13,2 +13,5 @@ "main": "index.js", | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"repository": { | ||
@@ -22,2 +25,3 @@ "type": "git", | ||
"fs-tree-diff": "^0.5.0", | ||
"debug": "^2.2.0", | ||
"mkdirp": "^0.5.1", | ||
@@ -24,0 +28,0 @@ "quick-temp": "^0.1.5", |
# TreeSync [![Build Status](https://travis-ci.org/stefanpenner/tree-sync.svg?branch=master)](https://travis-ci.org/stefanpenner/tree-sync) [![Build status](https://ci.appveyor.com/api/projects/status/7136sbfmybx6q7w2?svg=true)](https://ci.appveyor.com/project/embercli/tree-sync) | ||
A module for repeated efficient synchronizing two directories. | ||
```js | ||
// input/a/{a.js,b.js} | ||
// output/ | ||
var tree = new TreeSync('input', 'output') | ||
tree.sync(); | ||
// output is now contains copies of everything that is in input | ||
fs.unlink('/input/a/b/js'); | ||
// input / output have diverged | ||
tree.sync(); | ||
// difference is calculated and efficient patch to update `output` is created and applied | ||
``` |
21
2
3880
5
3
71
+ Addeddebug@^2.2.0