Skip to content

Commit

Permalink
fix: fixed an issue while parsing project name
Browse files Browse the repository at this point in the history
  • Loading branch information
philasmar committed Mar 21, 2024
1 parent c8740c6 commit 7d7dfc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .autover/changes/0801d6c5-6bc5-43d1-a088-08f6ef45bcff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"Projects": [
{
"Name": "AutoVer",
"Type": "Patch",
"ChangelogMessages": [
"Fixed an issue while parsing project name"
]
}
]
}
4 changes: 2 additions & 2 deletions src/AutoVer/Services/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private string GetProjectName(string projectPath)
throw new InvalidProjectException($"The project '{projectPath}' is invalid.");
var projectFileName = projectParts.Last();
var projectFileNameParts = projectFileName.Split('.');
if (projectFileNameParts.Length != 2)
if (projectFileNameParts.Length < 2)
throw new InvalidProjectException($"The project '{projectPath}' is invalid.");
return projectFileNameParts.First();
return projectFileName.Replace($".{projectFileNameParts.Last()}", "");
}
}

0 comments on commit 7d7dfc5

Please sign in to comment.