Replies: 3 comments 5 replies
-
Have you seen the IntegrationTests? The integration tests are executed via API. If I delete the .git folder I'm getting the following error: Edit: I have test it on main branch which reflects the beta.3 version. |
Beta Was this translation helpful? Give feedback.
-
Why was this closed when unanswered? |
Beta Was this translation helpful? Give feedback.
-
I think the best option for you would be to have This will allow to build the project from the zip. Then in your CI/CD you just set programatically the dotnet build some.csproj -p:DisableGitVersionTask=false And it should work |
Beta Was this translation helpful? Give feedback.
-
I am trying to get the current version of the GitRepository that my code is sitting in during the runtime of the application.
While most people use the latest version of my application from Winget, some folks run it in debug locally. This makes it difficult to ascertain what version of the code they are using, especially when they post segments of the log...
I added the "GitVersion.MSBuild" which does give the "next" version, but it fails if folks download the code without cloning the repo.
https://github.com/nkdAgility/azure-devops-migration-tools/blob/7fd7ba9d22a0f61148416637a6e441191f0c75f4/src/MigrationTools.Host/MigrationToolHost.cs#L151
The following occurs if I remove the
.git
folder to simulate this.I would like to be instead able to get the "CurrentVersion" from the repository with code (using
GitVersion.Core
) so that I can handle the exception when the folder is not a git repo.The documentation for how to use this is very sparse, and I have been trawling through the tests to find an entry point that I can use to make this call.
This is as far as I have been able to get, but I cant seem to get the last centimetre...
Any hints would be much appreciated and I do understand that this would not be supported.
Beta Was this translation helpful? Give feedback.
All reactions