From 5a8edd6353c88716da31e55b3c722b667148dba6 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 27 Nov 2024 13:58:43 +0100 Subject: [PATCH] ci(release): Add missing pre-commit hook script Signed-off-by: Christoph Wurst --- .gitignore | 5 ++++- build/pre-commit.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 build/pre-commit.js diff --git a/.gitignore b/.gitignore index 50e11cde2..05d270f49 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,10 @@ yarn-error.log* js/ /css/ -build/ + +# packaged app +build/artifacts + coverage* vendor/ diff --git a/build/pre-commit.js b/build/pre-commit.js new file mode 100644 index 000000000..225f757d0 --- /dev/null +++ b/build/pre-commit.js @@ -0,0 +1,14 @@ +/** + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +const fs = require('fs') + +exports.preCommit = (props) => { + const old = fs.readFileSync('appinfo/info.xml').toString('utf-8') + + const updated = old.replace(/(.+?)<\/version>/, '' + props.version + '') + + fs.writeFileSync('appinfo/info.xml', updated) +}