2023-03-09 03:37:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-03-10 02:01:20 +00:00
|
|
|
#sync libs'
|
|
|
|
|
|
|
|
if [ -f "$(which jq)" ]; then
|
|
|
|
HEADER=ino/lib/McopySerial/McopySerial.h
|
|
|
|
TMP_FILE=$(mktemp)
|
|
|
|
|
|
|
|
awk '{print} /CMD FLAGS/ {exit}' "${HEADER}" > "${TMP_FILE}"
|
|
|
|
|
2023-03-10 02:18:10 +00:00
|
|
|
cat ./data/cfg.json | jq -r '.arduino.cmd | keys[] as $k | " static const char \($k) = '"'"'\(.[$k])'"'"';"' | awk '{print "\t"$1" "$2" "$3" "toupper($4)" "$5" "$6}' >> "${TMP_FILE}"
|
2023-03-10 02:01:20 +00:00
|
|
|
|
|
|
|
awk '/END CMD/,EOF { print $0 }' "${HEADER}" >> "${TMP_FILE}"
|
|
|
|
|
|
|
|
cp "${TMP_FILE}" "${HEADER}"
|
|
|
|
rm -f "${TMP_FILE}"
|
|
|
|
fi
|
2023-03-09 03:37:40 +00:00
|
|
|
|
2023-03-10 02:54:54 +00:00
|
|
|
cp ino/lib/McopySerial/McopySerial.* ino/mcopy_cam_canon/
|
2023-03-18 21:13:41 +00:00
|
|
|
cp ino/lib/McopySerial/McopySerial.* ino/mcopy_JKMM100/
|
|
|
|
cp ino/lib/McopySerial/McopySerial.* ino/components/mcopy_light/
|