cc-codeline 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin.js +6 -7
- package/package.json +1 -1
package/README.md
ADDED
package/bin.js
CHANGED
|
@@ -24,6 +24,9 @@ const languages = {
|
|
|
24
24
|
'.vue': {
|
|
25
25
|
comment: /\/\*[\s\S]+?\*\/|\/\/.*|<!--[\s\S]+?-->/g
|
|
26
26
|
},
|
|
27
|
+
'.java': {
|
|
28
|
+
comment: /\/\*[\s\S]+?\*\/|\/\/.*/g
|
|
29
|
+
},
|
|
27
30
|
'.rs': {
|
|
28
31
|
comment: /\/\*[\s\S]+?\*\/|\/\/.*/g
|
|
29
32
|
},
|
|
@@ -63,10 +66,6 @@ codeline /path/ -l
|
|
|
63
66
|
-h Show help
|
|
64
67
|
-l Print log
|
|
65
68
|
`);
|
|
66
|
-
// console.table({
|
|
67
|
-
// '-h': 'Show help',
|
|
68
|
-
// '-l': 'Print log'
|
|
69
|
-
// });
|
|
70
69
|
return;
|
|
71
70
|
}
|
|
72
71
|
try {
|
|
@@ -81,7 +80,7 @@ codeline /path/ -l
|
|
|
81
80
|
});
|
|
82
81
|
}
|
|
83
82
|
} catch (_) {
|
|
84
|
-
console.log('
|
|
83
|
+
console.log('Error, the path may not exist');
|
|
85
84
|
}
|
|
86
85
|
})();
|
|
87
86
|
|
|
@@ -99,7 +98,7 @@ function readDirectory(dirPath, callback) {
|
|
|
99
98
|
let progress = 0;
|
|
100
99
|
fs.readdir(dirPath, (err, filenames) => {
|
|
101
100
|
if (err) {
|
|
102
|
-
console.log('
|
|
101
|
+
console.log('Error reading directory');
|
|
103
102
|
callback();
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
@@ -137,7 +136,7 @@ function readFile(filepath, callback) {
|
|
|
137
136
|
}
|
|
138
137
|
fs.readFile(filepath, (err, data) => {
|
|
139
138
|
if (err) {
|
|
140
|
-
console.log('
|
|
139
|
+
console.log('Error reading file');
|
|
141
140
|
callback();
|
|
142
141
|
return;
|
|
143
142
|
}
|