Skip to content

Commit 1365442

Browse files
authored
docs: Theme ids missing (#404)
1 parent d1ab17b commit 1365442

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

utils/scripts/get-cids.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ AWKCMD='
88
{
99
# On first record
1010
if ( NR == 1) {
11-
# Remove single quotes
12-
gsub(/\047/, "");
11+
# Remove single OR double quotes
12+
gsub(/[\047|\"]/, "");
1313
} else {
14-
# Replace first single quote with (,)
15-
sub(/\047/, ",", $4);
16-
# Remove single quotes
17-
gsub(/\047/, ""i, $4);
14+
# Replace first single OR double quote with (,)
15+
sub(/[\047|\"]/, ",", $4);
16+
# Remove single OR double quotes
17+
gsub(/[\047|\"]/, "", $4);
18+
# Remove COMPONENT_ID
19+
gsub(/[A-Z_{]*COMPONENT_ID[}]*/, "", $4);
20+
# Remove arrow functions
21+
gsub(/\(\{ [a-zA-Z]+ \}\)/, "", $4)
1822
}
1923
}
20-
# Print second column only which contains component_id
24+
# Print fourth column only which contains component_id
2125
{ print $4 }
2226
'
2327
grep \
@@ -27,7 +31,7 @@ grep \
2731
--include=\*.js \
2832
--exclude=\*.spec.js \
2933
-rn '../../packages' \
30-
-e "\'data-garden-id\': \'" \
34+
-e "data-garden-id" \
3135
-e "const [A-Z_]*COMPONENT_ID =" |
3236
sort | # Sort alphabetically
3337
awk "$AWKCMD" | # Run the above awk program

0 commit comments

Comments
 (0)