function getVersion()

in scripts/updateVersion.ts [59:66]


function getVersion(filePath: string, regex: RegExp): string {
    const fileContents = readFileSync(filePath).toString();
    const match = fileContents.match(regex);
    if (!match || !match[1]) {
        throw new Error(`Failed to find match for "${regex.source}".`);
    }
    return match[1];
}