-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 临时修复任务进度回退问题 * 更新版本号
- Loading branch information
Showing
9 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// 本脚本用于软著申请导出代码 | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
// 指定输出文件路径 | ||
const outputFilePath = 'code.txt'; | ||
|
||
// 递归扫描目录下的所有文件 | ||
function scanDirectory(dirPath) { | ||
const files = fs.readdirSync(dirPath); | ||
for (const file of files) { | ||
const filePath = path.join(dirPath, file); | ||
const stats = fs.statSync(filePath); | ||
if (stats.isDirectory()) { | ||
scanDirectory(filePath); | ||
} else { | ||
appendFileContent(filePath); | ||
} | ||
} | ||
} | ||
|
||
function removeBlankLines(text) { | ||
// 使用正则表达式匹配并移除所有空白行 | ||
return text.replace(/^\s*[\r\n]/gm, ''); | ||
} | ||
|
||
function removeComments(code) { | ||
// 使用正则表达式匹配并移除所有注释 | ||
return code.replace( | ||
/\/\*[\s\S]*?\*\/|\/\/.*|#.*(?:\n|$)/g, | ||
(match) => { | ||
// 检查是否为多行注释,如果是则返回换行符,否则返回空字符串 | ||
return /^\/\*/.test(match) ? '\n' : ''; | ||
} | ||
); | ||
} | ||
// 将文件内容写入输出文件 | ||
function appendFileContent(filePath) { | ||
const fileContent = fs.readFileSync(filePath, 'utf8'); | ||
const safeContent = removeBlankLines(removeComments(fileContent)) | ||
fs.appendFileSync(outputFilePath, `${filePath}\n${safeContent}\n\n`) | ||
} | ||
|
||
// 开始扫描当前目录 | ||
scanDirectory('./packages/harmony/library/src'); | ||
console.log(`文件内容已输出到 ${outputFilePath}`); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# Change logs | ||
|
||
## v1.0.2 (2024-07-26) | ||
|
||
### 改动 | ||
|
||
- 优化进度处理,避免进度回退 | ||
- 其他实现细节优化 | ||
|
||
## v1.0.1 (2024-07-09) | ||
|
||
### 改动 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters