Skip to content

Commit

Permalink
fix: 增加代码行数统计中 文件名含有空格的异常
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxudong13804 committed Feb 21, 2024
1 parent c27017c commit d644ec3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async function lintFiles(filePaths) {
// let stdout = execSync(`cloc --json ${filePathsStr}`).toString();
// console.log('wow\n', JSON.parse(stdout))

let stdout = execSync(`${clocPath} --json ${filePathsStr}`).toString();
let stdout = execSync(`${clocPath} --json '${filePathsStr}'`).toString();
totalBlankLines += JSON.parse(stdout)['SUM']?.blank || 0
totalCommentLines += JSON.parse(stdout)['SUM']?.comment || 0
totalCodeLines += JSON.parse(stdout)['SUM']?.code || 0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@afuteam/eslint-plugin-fe",
"version": "2.0.5-beta.8",
"version": "2.0.5-beta.9",
"description": "AfuTeam ESLint Plugin",
"main": "./lib/index.js",
"exports": {
Expand Down
12 changes: 12 additions & 0 deletions tests/filenamehasBLANK/a copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var a = 9

console.log(a)

const ban = 11

ban = 'ban'


console.log(c)

// ceshi o

0 comments on commit d644ec3

Please sign in to comment.