mirror of
https://github.com/ditkrg/project-version-check.git
synced 2026-01-22 22:06:42 +00:00
Fix errors
Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
parent
8d8142bf0e
commit
337fc055f9
23
index.js
23
index.js
@ -171,20 +171,23 @@ function getProjectInfoFile(filePath) {
|
||||
return require(`${process.cwd()}/${filePath}`);
|
||||
}
|
||||
|
||||
function getProjectVersion(file) {
|
||||
function getProjectVersion(filePath) {
|
||||
const projectInfoFile = require(filePath);
|
||||
|
||||
// Update the version if the file is .csproj
|
||||
if (file.match(/\.csproj/))
|
||||
return file.Project.PropertyGroup[0].Version;
|
||||
else if (file.match(/package\.json/))
|
||||
return file.version;
|
||||
if (filePath.match(/\.csproj/))
|
||||
return projectInfoFile.Project.PropertyGroup[0].Version;
|
||||
else if (filePath.match(/package\.json/))
|
||||
return projectInfoFile.version;
|
||||
|
||||
}
|
||||
function updateProjectVersion(file, newVersion) {
|
||||
function updateProjectVersion(filePath, newVersion) {
|
||||
|
||||
const projectInfoFile = require(filePath);
|
||||
|
||||
// Update the version if the file is .csproj
|
||||
if (file.match(/\.csproj/))
|
||||
file.Project.PropertyGroup[0].Version = newVersion;
|
||||
else if (file.match(/package\.json/))
|
||||
file.version = newVersion;
|
||||
if (filePath.match(/\.csproj/))
|
||||
projectInfoFile.Project.PropertyGroup[0].Version = newVersion;
|
||||
else if (filePath.match(/package\.json/))
|
||||
projectInfoFile.version = newVersion;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user