2FAuth/vite.version.js
2023-11-27 13:18:38 +01:00

17 lines
379 B
JavaScript
Vendored

import * as fs from 'fs';
import { Engine } from 'php-parser';
const parser = new Engine({
parser: {
extractDoc: false,
},
ast: {
withPositions: true,
},
})
const phpFile = fs.readFileSync("./config/2fauth.php")
const phpContent = parser.parseCode(phpFile)
const version = phpContent.children[0].expr.items[0].value.value
export default version