Skip to content

Commit

Permalink
Changed references of path.existsSync to fs.existsSync. Updated requi…
Browse files Browse the repository at this point in the history
…red node engine to 0.7.1. Bumped version to 1.0.3. Fixes #3.
  • Loading branch information
beefsack committed Jun 28, 2012
1 parent c6f13b3 commit 0f46417
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hound.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Hound.prototype.watch = function(src) {
}
}
self.watchers[src] = fs.watch(src, function(event, filename) {
if (path.existsSync(src)) {
if (fs.existsSync(src)) {
stats = fs.statSync(src)
if (stats.isFile()) {
self.emit('change', src, stats)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "hound",
"description": "Cross platform directory tree watcher, focussed on reliability, speed, and simplicity.",
"keywords": ["directory", "tree", "watch", "windows", "cross", "platform", "reliable", "simple", "fast"],
"version": "1.0.2",
"version": "1.0.3",
"homepage": "https://github.com/beefsack/node-hound",
"bugs": "https://github.com/beefsack/node-hound/issues",
"repository": {
Expand All @@ -20,6 +20,6 @@
},
"optionalDependencies": {},
"engines": {
"node": "*"
"node": ">=0.7.1"
}
}
6 changes: 3 additions & 3 deletions spec/hound.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var testSource = path.normalize(__dirname + '/data')
* @param {string} src
*/
function deleteFile(src) {
if (!path.existsSync(src)) return
if (!fs.existsSync(src)) return
var stat = fs.statSync(src)
// if (stat === undefined) return
if (stat.isDirectory()) {
Expand All @@ -33,13 +33,13 @@ function deleteFile(src) {
function copyFile(src, dest) {
stat = fs.statSync(src)
if (stat.isDirectory()) {
if (!path.existsSync(dest)) fs.mkdirSync(dest)
if (!fs.existsSync(dest)) fs.mkdirSync(dest)
var files = fs.readdirSync(src)
for (var i = 0, len = files.length; i < len; i++) {
copyFile(src + '/' + files[i], dest + '/' + files[i])
}
} else {
if (!path.existsSync(dest)) {
if (!fs.existsSync(dest)) {
util.pump(fs.createReadStream(src), fs.createWriteStream(dest))
}
}
Expand Down

0 comments on commit 0f46417

Please sign in to comment.