move fs methods into their own module

This commit is contained in:
Iuri Matias 2017-02-19 11:37:54 -05:00
parent 4e8546863c
commit 8da0e80751
8 changed files with 37 additions and 7 deletions

View File

@ -1,4 +1,4 @@
var fs = require('fs-extra'); var fs = require('./fs.js');
var colors = require('colors'); var colors = require('colors');
var GethCommands = require('./geth_commands.js'); var GethCommands = require('./geth_commands.js');
var utils = require('./utils.js'); var utils = require('./utils.js');

View File

@ -1,4 +1,4 @@
var fs = require('fs-extra'); var fs = require('./fs.js');
var Plugins = require('./plugins.js'); var Plugins = require('./plugins.js');
var utils = require('./utils.js'); var utils = require('./utils.js');

View File

@ -1,4 +1,4 @@
var fs = require('fs-extra'); var fs = require('./fs.js');
var DeployTracker = function(options) { var DeployTracker = function(options) {
this.logger = options.logger; this.logger = options.logger;

30
lib/fs.js Normal file
View File

@ -0,0 +1,30 @@
var fs = require('fs-extra');
function mkdirpSync() {
return fs.mkdirpSync.apply(fs.mkdirpSync, arguments);
}
function copySync() {
return fs.copySync.apply(fs.copySync, arguments);
}
function readFileSync() {
return fs.readFileSync.apply(fs.readFileSync, arguments);
}
function readJSONSync() {
return fs.readJSONSync.apply(fs.readJSONSync, arguments);
}
function writeJSONSync() {
return fs.writeJSONSync.apply(fs.writeJSONSync, arguments);
}
module.exports = {
mkdirpSync: mkdirpSync,
copySync: copySync,
readFileSync: readFileSync,
readJSONSync: readJSONSync,
writeJSONSync: writeJSONSync
};

View File

@ -1,5 +1,5 @@
/*jshint esversion: 6, loopfunc: true */ /*jshint esversion: 6, loopfunc: true */
var fs = require('fs-extra'); var fs = require('./fs.js');
var Pipeline = function(options) { var Pipeline = function(options) {
this.buildDir = options.buildDir; this.buildDir = options.buildDir;

View File

@ -1,5 +1,5 @@
/*jshint esversion: 6, loopfunc: true */ /*jshint esversion: 6, loopfunc: true */
var fs = require('fs-extra'); var fs = require('./fs.js');
var utils = require('./utils.js'); var utils = require('./utils.js');
// TODO: pass other params like blockchainConfig, contract files, etc.. // TODO: pass other params like blockchainConfig, contract files, etc..

View File

@ -1,4 +1,4 @@
var fs = require('fs-extra'); var fs = require('./fs.js');
var utils = require('./utils.js'); var utils = require('./utils.js');
var TemplateGenerator = function(templateName) { var TemplateGenerator = function(templateName) {

View File

@ -1,5 +1,5 @@
/*jshint esversion: 6 */ /*jshint esversion: 6 */
var fs = require('fs-extra'); var fs = require('./fs.js');
var chokidar = require('chokidar'); var chokidar = require('chokidar');
// TODO: this should be receiving the config object not re-reading the // TODO: this should be receiving the config object not re-reading the