INNER CODE UNIT · TypeScript
versionRegex
KinsonDigital/Velaptor · .github/cicd-scripts/update-velaptor-nuget-versions.ts:52
const versionRegex = /([1-9]\d*|0)\.([1-9]\d*|0)\.([1-9]\d*|0)(-preview\.([1-9]\d*))?/;
const oldVersion = versionRegex.exec(velaptorNuGetRef)?.map((match) => match.toString())[0] ?? "";
const newFileData = fileData.replace(velaptorNuGetRegex, newNugetPackage);
Deno.writeTextFileSync(csProjFile, newFileData);
const updateFileMsg = `The NuGet package 'KinsonDigital.Velaptor' was updated from version` +
`'${oldVersion}' to version '${newVersion}' in the csproj file '${csProjFile}'`;
printGitHubNotice(updateFileMsg);
}
} catch (error) {
const errorMsg = error instanceof Error ? error.message : String(error);
printGitHubError(`Error updating Velaptor nuget package in csproj file '${csProjFile}'.\n\t${errorMsg}`);
Deno.exit();
}
});