[Pkg-javascript-commits] [less.js] 34/50: use graceful fs for file actions
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:22:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v1.7.1
in repository less.js.
commit 501b7fa9a685e0d26eb4bf83567b569d4c414ae5
Author: Luke Page <luke.a.page at gmail.com>
Date: Sun May 11 07:44:33 2014 +0100
use graceful fs for file actions
---
bin/lessc | 2 +-
lib/less/fs.js | 10 ++++++++++
lib/less/functions.js | 2 +-
lib/less/index.js | 2 +-
package.json | 1 +
5 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/bin/lessc b/bin/lessc
index 2a83cb3..1eb3c95 100755
--- a/bin/lessc
+++ b/bin/lessc
@@ -1,7 +1,7 @@
#!/usr/bin/env node
var path = require('path'),
- fs = require('fs'),
+ fs = require('../lib/less/fs'),
sys = require('util'),
os = require('os'),
mkdirp;
diff --git a/lib/less/fs.js b/lib/less/fs.js
new file mode 100644
index 0000000..d124f84
--- /dev/null
+++ b/lib/less/fs.js
@@ -0,0 +1,10 @@
+var fs;
+try
+{
+ fs = require("graceful-fs");
+}
+catch(e)
+{
+ fs = require("fs");
+}
+module.exports = fs;
diff --git a/lib/less/functions.js b/lib/less/functions.js
index 42d1bb2..de758ea 100644
--- a/lib/less/functions.js
+++ b/lib/less/functions.js
@@ -414,7 +414,7 @@ tree.functions = {
var mimetype = mimetypeNode.value;
var filePath = (filePathNode && filePathNode.value);
- var fs = require('fs'),
+ var fs = require('./fs'),
path = require('path'),
useBase64 = false;
diff --git a/lib/less/index.js b/lib/less/index.js
index 715ea5a..9b8ee3f 100644
--- a/lib/less/index.js
+++ b/lib/less/index.js
@@ -1,7 +1,7 @@
var path = require('path'),
url = require('url'),
request,
- fs = require('fs');
+ fs = require('./fs');
var less = {
version: [1, 7, 0],
diff --git a/package.json b/package.json
index 148d522..a19ce64 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"test": "grunt test"
},
"optionalDependencies": {
+ "graceful-fs": "~2.0.3",
"mime": "1.2.x",
"request": ">=2.33.0",
"mkdirp": "~0.3.5",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git
More information about the Pkg-javascript-commits
mailing list