diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef0b1be5..90381c2e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,7 @@ before_script: name: "${CI_PROJECT_NAME}_Supported_Devices_${CI_COMMIT_SHORT_SHA}" paths: - ./*.md + - Supported Devices.csv exclude: - README.md - CONTRIBUTING.md diff --git a/scripts/build-supported-devices-md.sh b/scripts/build-supported-devices-md.sh index b1cab5fd..e1d55208 100755 --- a/scripts/build-supported-devices-md.sh +++ b/scripts/build-supported-devices-md.sh @@ -17,6 +17,8 @@ USB_DEVICE_TABLE_HEAD='| Vendor ID | Product ID | Device Name |\n' GPU_DEVICE_TABLE_HEAD='| Vendor &
Device ID | Sub-Vendor &
Product ID | Device Name |\n' DEVICE_TABLE_ALIGN='| :---: | :---: | :--- |' MAIN_FILE='Supported Devices.md' +CSV_TABLE_HEAD='Name,Category,Type,RGBController,VID,PID,SVID,SPID,Save,Direct,Effects,Comments' +CSV_FILE='Supported Devices.csv' ## Symbol Declarations WHITE_CHECK_MARK_STRING=':white_check_mark:' @@ -86,6 +88,8 @@ echo -e "| ${TOOLS} | Partially supported by OpenRGB
See device page for det echo -e "| ${NO_ENTRY} | Not currently supported by OpenRGB |" >> "$MAIN_FILE" echo -e "| ${CROSS} | Not applicable for this device |" >> "$MAIN_FILE" +echo -e "${CSV_TABLE_HEAD}" > "${CSV_FILE}" + while read -r controller do ## 's/\r$//' - Convert DOS text to Unix text @@ -268,7 +272,9 @@ do vid=${vid/0x/} pid=${pid/0x/} device_name=${device_name//[^[:alnum:][:punct:][:blank:]]/} - + escaped_comment=$(LC_ALL=C sed 's/["]/""/g' <<<"$comment") + + csv_row=$(printf '"%s","%s","%s","%s","%s","%s","","","%s","%s","%s","%s"\n' "${device_name//|/\\|}" "${categories//|/\\|}" "${type//|/\\|}" "${name//|/\\|}" "${vid/ /}" "${pid/ /}" "${save}" "${direct}" "${effects}" "${escaped_comment}") table_row=$(printf '| `%s` | `%s` | %s |' "${vid/ /}" "${pid/ /}" "${device_name//|/\\|}") ;; I2C | SMBus) @@ -279,7 +285,9 @@ do svid=${svid/0x/} spid=${spid/0x/} device_name=${device_name//[^[:alnum:][:punct:][:blank:]]/} + escaped_comment=$(LC_ALL=C sed 's/["]/""/g' <<<"$comment") + csv_row=$(printf '"%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s","%s"\n' "${device_name//|/\\|}" "${categories//|/\\|}" "${type//|/\\|}" "${name//|/\\|}" "${vid/ /}" "${pid/ /}" "${svid/ /}" "${spid/ /}" "${save}" "${direct}" "${effects}" "${escaped_comment}") table_row=$(printf '| `%s:%s` | `%s:%s` | %s |' "${vid/ /}" "${pid/ /}" "${svid/ /}" "${spid/ /}" "${device_name//|/\\|}") ;; *) @@ -289,6 +297,7 @@ do if [[ $table_row = *[![:blank:]]* ]]; then echo -e "$table_row" >>"$outfile" + echo -e "$csv_row" >>"$CSV_FILE" fi done <<< "$text" done <<< "$detectors"