Skip to content

Commit

Permalink
fix: convert pre-commit to common js
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
  • Loading branch information
hamza221 authored and backportbot[bot] committed Dec 19, 2024
1 parent fa13535 commit 06689fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build/pre-commit.js → build/pre-commit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(.+?)<\/version>/, '<version>' + props.version + '</version>')

writeFileSync('appinfo/info.xml', updated)
fs.writeFileSync('appinfo/info.xml', updated)
}

0 comments on commit 06689fd

Please sign in to comment.