Skip to content

Commit

Permalink
123
Browse files Browse the repository at this point in the history
  • Loading branch information
id77 committed Nov 23, 2024
1 parent 2dd9450 commit a9a29f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions task/clearTaskFileData.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ async function task() {
fileContent.includes(`//注入数据end`)
) {
const _fileContent = fileContent.replace(
/\/\/start[\s\S\n]*\/\/end\n/,
``
/(\/\/start)[\s\S\n]*(\/\/end\n)/,
`$1\n$2`
);
await $.writeFile(_fileContent);
} else {
Expand Down
5 changes: 1 addition & 4 deletions task/dataToTaskFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ async function task() {

if (reqArrStr && !fileContent.includes(reqArrStr)) {
const _fileContent = fileContent
.replace(
/(.*?\n)/,
`$1//注入数据start\n${reqArrStr}\n//注入数据end\n`
)
.replace(/(\/\/start.*?\n)/, `$1\n${reqArrStr}\n`)
.replace(
/(\.\.\.mitmDatas,|mitmDatas\[mitmDatas.length-1\],)/g,
(match, p1, offset, string) => {
Expand Down
5 changes: 1 addition & 4 deletions task/iCloudDataToTaskFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ async function task() {
let _fileContent = '';
if (reqArrStr && !fileContent.includes(reqArrStr)) {
_fileContent += fileContent
.replace(
/(.*?\n)/,
`$1//注入数据start\n${reqArrStr}\n//注入数据end\n`
)
.replace(/(\/\/start.*?\n)/, `$1\n${reqArrStr}\n`)
.replace(
/(\.\.\.mitmDatas,|mitmDatas\[mitmDatas.length-1\],)/g,
(match, p1, offset, string) => {
Expand Down

0 comments on commit a9a29f7

Please sign in to comment.