From 1d859b5afa88583dc27027fe14d0aa13e24a44a3 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 13 Nov 2018 14:31:31 +0100 Subject: sync API version with PeerTube version and auto-update it via git hooks --- package.json | 2 +- scripts/openapi-peertube-version.sh | 4 ++++ support/doc/api/openapi.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 scripts/openapi-peertube-version.sh diff --git a/package.json b/package.json index bc514920d..3c77b93cb 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ }, "husky": { "hooks": { - "pre-commit": "lint-staged" + "pre-commit": "lint-staged && ./scripts/openapi-peertube-version.sh" } }, "lint-staged": { diff --git a/scripts/openapi-peertube-version.sh b/scripts/openapi-peertube-version.sh new file mode 100755 index 000000000..c638291f6 --- /dev/null +++ b/scripts/openapi-peertube-version.sh @@ -0,0 +1,4 @@ +# Version key/value should be on his own line +PACKAGE_VERSION=$(node -p "require('./package.json').version") + +sed -i "s/\(^\s*\)version: .*/\1version: $PACKAGE_VERSION/" support/doc/api/openapi.yaml diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 59ca8b29a..f3520a7b1 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1,7 +1,7 @@ swagger: '2.0' info: title: PeerTube - version: 1.0.0-beta + version: 1.1.0-alpha.2 description: Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly in the web browser with WebTorrent and Angular. host: peertube.example.com securityDefinitions: -- cgit v1.2.3