Fix errors

Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar 2023-09-19 11:04:40 +03:00
parent 8d8142bf0e
commit 337fc055f9
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28

View File

@ -171,20 +171,23 @@ function getProjectInfoFile(filePath) {
return require(`${process.cwd()}/${filePath}`); return require(`${process.cwd()}/${filePath}`);
} }
function getProjectVersion(file) { function getProjectVersion(filePath) {
const projectInfoFile = require(filePath);
// Update the version if the file is .csproj // Update the version if the file is .csproj
if (file.match(/\.csproj/)) if (filePath.match(/\.csproj/))
return file.Project.PropertyGroup[0].Version; return projectInfoFile.Project.PropertyGroup[0].Version;
else if (file.match(/package\.json/)) else if (filePath.match(/package\.json/))
return file.version; return projectInfoFile.version;
} }
function updateProjectVersion(file, newVersion) { function updateProjectVersion(filePath, newVersion) {
const projectInfoFile = require(filePath);
// Update the version if the file is .csproj // Update the version if the file is .csproj
if (file.match(/\.csproj/)) if (filePath.match(/\.csproj/))
file.Project.PropertyGroup[0].Version = newVersion; projectInfoFile.Project.PropertyGroup[0].Version = newVersion;
else if (file.match(/package\.json/)) else if (filePath.match(/package\.json/))
file.version = newVersion; projectInfoFile.version = newVersion;
} }