Skip to content

Commit

Permalink
remove console.log from fileHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
nagpalkaran95 committed May 8, 2020
1 parent 4d37104 commit fc3d9c0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/helpers/fileHelpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';
var fs = require('fs-extra');
var path = require('path');
var mkdirp = require('mkdirp')
const fs = require('fs-extra'),
path = require('path'),
mkdirp = require('mkdirp');

const logger = require('./logger').winstonLogger;

exports.isEmpty = function(path, cb) {
fs.readdir(path, function(err, files) {
Expand Down Expand Up @@ -33,15 +35,15 @@ exports.isFile = function(path, cb) {
exports.mkdir = function(dir, cb) {
mkdirp(dir, '0755', function(err) {
if (err) throw err;
console.log('Creating directory: ./' + path.relative(process.cwd(), dir))
logger.info("Creating directory: ./" + path.relative(process.cwd(), dir));
cb && cb()
})
}

exports.write = function(f, message, cb) {
message = message || 'Creating';
fs.writeFile(f.path, f.file, function() {
console.log(message + ' file: ./' + path.relative(process.cwd(), f.path));
logger.info(message + " file: ./" + path.relative(process.cwd(), f.path));
cb && cb()
});
}
Expand Down

0 comments on commit fc3d9c0

Please sign in to comment.