Skip to content

Commit

Permalink
Merge pull request #4255 from nextcloud/fix/convert-to-cjs
Browse files Browse the repository at this point in the history
fix: convert pre-commit to common js
  • Loading branch information
ChristophWurst authored Dec 19, 2024
2 parents a7ae736 + afd5a5a commit 1bc9192
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 1bc9192

Please sign in to comment.