Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
Falcon
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Walter Huang
Falcon
Commits
b77d563e
Commit
b77d563e
authored
Jun 27, 2025
by
Lin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: upload the files to google sheet
parent
05c2c74c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
sendDiffToGoogleSheets.ts
...detect_section_selector_masters/sendDiffToGoogleSheets.ts
+18
-1
No files found.
src/detect_section_selector_masters/sendDiffToGoogleSheets.ts
View file @
b77d563e
...
...
@@ -19,7 +19,24 @@ async function uploadAllToSheets() {
const
dirNames
=
useAiSelectors
?
[
'diffAINavWithBaseline'
,
'diffAIWithBaseline'
]
:
[
'diffNavWithBaseline'
,
'diffWithBaseline'
];
const
files
=
dirNames
.
flatMap
(
subdir
=>
{
// 拆分主目录(primary)和备用目录(secondary)。
// 读取主目录下所有 JSON,检查是否有非空数组。
// 如果主目录有内容,只上传主目录文件;否则上传备用目录文件。
const
[
primary
,
secondary
]
=
dirNames
;
const
primaryDir
=
join
(
__dirname
,
primary
);
const
primaryFiles
=
readdirSync
(
primaryDir
).
filter
(
f
=>
f
.
endsWith
(
'.json'
));
let
usePrimary
=
false
;
for
(
const
f
of
primaryFiles
)
{
const
raw
=
readFileSync
(
join
(
primaryDir
,
f
),
'utf-8'
);
const
data
=
JSON
.
parse
(
raw
);
if
(
Array
.
isArray
(
data
)
&&
data
.
length
>
0
)
{
usePrimary
=
true
;
break
;
}
}
const
dirsToUpload
=
usePrimary
?
[
primary
]
:
[
secondary
];
const
files
=
dirsToUpload
.
flatMap
(
subdir
=>
{
const
d
=
join
(
__dirname
,
subdir
);
return
readdirSync
(
d
)
.
filter
(
f
=>
f
.
endsWith
(
'.json'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment