Skip to content

Commit 4b0e6ee

Browse files
committed
remove unnecessary comments, add useful comments
1 parent b4d6786 commit 4b0e6ee

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

scripts/cleanup.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,7 @@
66
* Original author of this script: [email protected]
77
*/
88

9-
109
var fs = require("fs");
11-
// var doclistPath = '/Users/sperberx/dev/essential-javascript-links/misc/';
12-
// var doclistName = 'README-short1';
13-
// var doclistAddon = '-new';
14-
// var doclistExtension = '.md';
15-
16-
/*
17-
files I'm testing with
18-
/Users/sperberx/dev/essential-javascript-links/misc/some-wrong-apos.md
19-
/Users/sperberx/dev/essential-javascript-links/README.md
20-
/Users/sperberx/dev/essential-javascript-links/misc/README-ee.md
21-
/Users/sperberx/dev/essential-javascript-links/misc/README-short1.md
22-
*/
23-
2410

2511
// identify each type of change, particularly for the apostrophe, since global change (e.g., /.'./g or /(\w|\d)'(\w|\d)/g) is just too risky
2612
// By making only known changes, stray apostrophes and quotes can be located easily
@@ -41,11 +27,7 @@ var replacements = [
4127
{ searchFor: /\b"/g, replaceWith: '”'}, // close quote (eg, is preceded by a 'word boundary') needs to be set to follow punctuation as well
4228
{ searchFor: / - /g, replaceWith: " — "} // em dash
4329
];
44-
45-
/* store components of path */
46-
// var pathAndFile = doclistPath + doclistName + doclistExtension; // /Users/sperberx/dev/essential-javascript-links/README.md
47-
// var pathAndFileNew = doclistPath + doclistName+ doclistAddon + doclistExtension; // /Users/sperberx/dev/essential-javascript-links/README-new.md
48-
30+
// using package.json script: cleanup to read README.md via cat
4931
var aFile = fs.readFile('/dev/stdin', 'utf8', function (err,data) {
5032
if (err) {
5133
return console.log(err);
@@ -59,14 +41,7 @@ var aFile = fs.readFile('/dev/stdin', 'utf8', function (err,data) {
5941
return someFile;
6042
}
6143
var result = cleanUp(data);
62-
44+
// now pipe the result to be stored in build/README.md
6345
console.log(result);
64-
// console.log('got result back');
65-
66-
// fs.writeFile(pathAndFileNew, result, function (err) {
67-
// if (err) throw err;
68-
// console.log('It\'s saved!');
69-
// });
7046

7147
});
72-

0 commit comments

Comments
 (0)