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 <[email protected]>
  • Loading branch information
hamza221 committed Dec 19, 2024
1 parent a7ae736 commit afd5a5a
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 afd5a5a

Please sign in to comment.