Skip to content

Commit

Permalink
make fs-ext optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Mar 31, 2014
1 parent 9404e81 commit 752d0f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/local-fs.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
var fs = require('fs')
, fsExt = require('fs-ext')
, Path = require('path')
, mkdirp = require('mkdirp')
, mystreams = require('./streams')
, FSError = require('./error').FSError

try {
var fsExt = require('fs-ext')
} catch(e) {
fsExt = {
flock: function() {
arguments[arguments.length-1]()
}
}
}

function write(dest, data, cb) {
var safe_write = function(cb) {
var tmpname = dest + '.tmp' + String(Math.random()).substr(2)
Expand Down
4 changes: 3 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ dependencies:
semver: '>= 2.2.1'
minimatch: '>= 0.2.14'
bunyan: '>= 0.22.1'
fs-ext: '>= 0.3.2'
mkdirp: '>= 0.3.5'

optionalDependencies:
fs-ext: '>= 0.3.2'

devDependencies:
rimraf: '>= 2.2.5'
mocha: '>= 1.17.0'
Expand Down

0 comments on commit 752d0f6

Please sign in to comment.