generated from homebridge/homebridge-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
generate-docs.sh
executable file
·20 lines (16 loc) · 779 Bytes
/
generate-docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env sh
# Determine vesrion of zigbee-herdsman-converters based on latest Zigbee2MQTT release
Z2M_VERSION=$(npm view zigbee2mqtt@latest version)
HERDSMAN_VERSION=$(npm view "zigbee2mqtt@$Z2M_VERSION" dependencies.zigbee-herdsman-converters)
# Write version to file so they can be mentioned in the documentation
DOC_VERSIONS_FILE=src/docgen/versions.ts
{
echo "// GENERATED FILE: DO NOT EDIT MANUALLY!"
echo "const version_zigbee2mqtt = '$Z2M_VERSION';"
echo "const version_herdsman_converters = '$HERDSMAN_VERSION';"
echo "export { version_zigbee2mqtt, version_herdsman_converters };"
} > $DOC_VERSIONS_FILE
# Install the new version
npm i --no-save zigbee-herdsman-converters@${HERDSMAN_VERSION}
# Run documentation script
ts-node src/docgen/docgen.ts