fix: convert pre-commit to common js
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
This commit is contained in:
Родитель
a7ae7362d2
Коммит
afd5a5a060
|
@ -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)
|
||||
}
|
Загрузка…
Ссылка в новой задаче