Skip to content

Commit

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

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

0 comments on commit 6ec1672

Please sign in to comment.