From 130323559becdea4934c099b9c9e41147618ebaf Mon Sep 17 00:00:00 2001 From: Thomas Genin Date: Mon, 9 Nov 2015 20:48:48 -0800 Subject: [PATCH] Style fixes --- cli.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cli.js b/cli.js index 4b4eb7c..be0e86c 100755 --- a/cli.js +++ b/cli.js @@ -190,14 +190,14 @@ cli.main(function(args, options) { } } - function createDirectory(path){ - try{ + function createDirectory(path) { + try { fs.mkdirSync(path); } - catch(e){ - if (e.code == 'EEXIST') { - return; - } + catch (e) { + if (e.code === 'EEXIST') { + return; + } cli.fatal('Can not create directory ' + path); cli.exit(3); } @@ -207,7 +207,7 @@ cli.main(function(args, options) { createDirectory(outputDir); var fileList = fs.readdirSync(inputDir); - fileList.forEach(function(fileName){ + fileList.forEach(function(fileName) { var inputFilePath = inputDir + '/' + fileName; var outputFilePath = outputDir + '/' + fileName; @@ -295,7 +295,7 @@ cli.main(function(args, options) { try { fs.statSync(inputDir); } - catch(e) { + catch (e) { cli.error('The input directory does not exits'); cli.exit(2); } @@ -306,9 +306,10 @@ cli.main(function(args, options) { cli.exit(2); } - try{ + try { processDirectory(inputDir, outputDir); - } catch(e) { + } + catch (e) { cli.error('Something wrong happened'); cli.error(e); cli.exit(3); -- 2.34.1