Permalink
Browse files

fixing deprecation warning: replacing path.existsSync with fs version…

… for node 0.8
  • Loading branch information...
1 parent 64c3e49 commit 889d483827afaedec11e5004c5881469fc95157e @pwmckenna pwmckenna committed Dec 3, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 tasks/crx.js
View
@@ -34,16 +34,18 @@ function configure(defaults){
var grunt = this;
var self = grunt.task.current;
var p = buildConfigProperty.bind(self);
+ // Support both 0.6 and 0.8. path.existsSync is deprecated
+ var existsSync = fs.existsSync || path.existsSync;
// Configuring stuff
self.requiresConfig(p('dest'), p('src'));
grunt.utils._.defaults(self.data, defaults);
// Checking availability
- if (!path.existsSync(self.file.src)){
+ if (!existsSync(self.file.src)){
throw self.taskError('Unable to locate source directory.');
}
- if (!path.existsSync(self.data.privateKey)){
+ if (!existsSync(self.data.privateKey)){
throw self.taskError('Unable to locate your private key.');
}

0 comments on commit 889d483

Please sign in to comment.