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