From afd5a5a0600e0bfb9836e137105e3ede8cd7d749 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Thu, 19 Dec 2024 19:17:34 +0700 Subject: [PATCH] fix: convert pre-commit to common js Signed-off-by: Hamza Mahjoubi --- build/{pre-commit.js => pre-commit.cjs} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename build/{pre-commit.js => pre-commit.cjs} (62%) diff --git a/build/pre-commit.js b/build/pre-commit.cjs similarity index 62% rename from build/pre-commit.js rename to build/pre-commit.cjs index 3441bb94b..51ee28259 100644 --- a/build/pre-commit.js +++ b/build/pre-commit.cjs @@ -3,12 +3,12 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { readFileSync, writeFileSync } from 'fs' +exports.preCommit = async (props) => { + const fs = await import('fs') -export function preCommit(props) { - const old = readFileSync('appinfo/info.xml').toString('utf-8') + const old = fs.readFileSync('appinfo/info.xml').toString('utf-8') const updated = old.replace(/(.+?)<\/version>/, '' + props.version + '') - writeFileSync('appinfo/info.xml', updated) + fs.writeFileSync('appinfo/info.xml', updated) }