Comparing version 0.0.5 to 0.0.6
22
index.js
@@ -21,3 +21,3 @@ #!/usr/bin/env node | ||
} | ||
var replaceCount = 0, skipCount = 0, fileCount = 0; | ||
var replaceCount = 0, skipParseErrorCount = 0, skipSingleQuoteErrorCount = 0, unknownErrorCount = 0, fileCount = 0; | ||
args.forEach(function (dirOrFile) { | ||
@@ -33,4 +33,14 @@ var finder = findit(dirOrFile); | ||
} catch (ex) { | ||
skipCount++; | ||
verbose && console.log('Skipping file because of error parsing file or bug in jsq: %s', file, ex); | ||
if(ex.code==='singlequote'){ | ||
skipSingleQuoteErrorCount++; | ||
verbose && console.log('Skipping file because jsq did not handle code correctly:\n%s', file, ex.inner); | ||
return; | ||
} | ||
if(ex.code==='parse'){ | ||
skipParseErrorCount++; | ||
verbose && console.log('Skipping file because it can not be parsed as valid JavaScript:\n%s', file, ex.inner); | ||
return; | ||
} | ||
unknownErrorCount++; | ||
verbose && console.log('Skipping file because of unknown internal error:\n%s', file, ex.inner); | ||
return; | ||
@@ -50,4 +60,8 @@ } | ||
console.log('%d .js files were scanned by jsq', fileCount); | ||
skipCount && console.log('%s of those were skipped because of error parsing file or bug in jsq', skipCount, | ||
skipParseErrorCount && console.log('%s of those were skipped because of error parsing JavaScript in file', skipParseErrorCount, | ||
verbose ? '' : '(use -v param to see details)'); | ||
skipSingleQuoteErrorCount && console.log('%s of those were skipped because jsq could not handle them correctly (we accept pull requests)', skipSingleQuoteErrorCount, | ||
verbose ? '' : '(use -v param to see details)'); | ||
unknownErrorCount && console.log('%s of those were skipped because unknown internal errors in jsq', unknownErrorCount, | ||
verbose ? '' : '(use -v param to see details)'); | ||
console.log('%s of those had double quoted JavaScript strings replaced', replaceCount || 'None'); | ||
@@ -54,0 +68,0 @@ }); |
{ | ||
"name": "jsq", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Command line tool for repacing all double quoted strings with single quoted strings in a file or directory. Usage: jsq fileOrDirectory [fileOrDirectory [..]]", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14169
66