diff --git a/utils/scripts/get-cids.sh b/utils/scripts/get-cids.sh index 9ab0fa38b1c..d12606adffc 100755 --- a/utils/scripts/get-cids.sh +++ b/utils/scripts/get-cids.sh @@ -1,10 +1,10 @@ #!/bin/bash AWKCMD=' - # Split record by (=) - BEGIN { FS = "="; } - # Remove all semicolons - { gsub(/;/, "") } + # Split record by (= | :) + BEGIN { FS = "[=:]"; } + # Remove all semicolons and commas + { gsub(/[;,]/, "") } { # On first record if ( NR == 1) { @@ -12,22 +12,23 @@ AWKCMD=' gsub(/\047/, ""); } else { # Replace first single quote with (,) - sub(/\047/, ","); + sub(/\047/, ",", $4); # Remove single quotes - gsub(/\047/, ""); + gsub(/\047/, ""i, $4); } } # Print second column only which contains component_id - { print $2 } + { print $4 } ' - grep \ --exclude-dir=.template \ --exclude-dir=node_modules \ + --exclude-dir=dist \ --include=\*.js \ --exclude=\*.spec.js \ - -rnw '../../packages' \ - -e 'const [A-Z_]*COMPONENT_ID = ' | # Find all COMPONENT_IDs + -rn '../../packages' \ + -e "\'data-garden-id\': \'" \ + -e "const [A-Z_]*COMPONENT_ID =" | sort | # Sort alphabetically awk "$AWKCMD" | # Run the above awk program tr '\n' ' ' # Collapse result to single line