Skip to content

Commit

Permalink
fixing some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Dec 9, 2024
1 parent 012c377 commit e2734f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitVersion.App/ArgumentParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void ParseTargetPath(Arguments arguments, string? name, IReadOnlyList<st
{
EnsureArgumentValueCount(values);
arguments.TargetPath = value;
if (!this.fileSystem.DirectoryExists(value))
if (string.IsNullOrWhiteSpace(value) || !this.fileSystem.DirectoryExists(value))
{
this.console.WriteLine($"The working directory '{value}' does not exist.");
}
Expand Down
4 changes: 4 additions & 0 deletions src/GitVersion.Core/Core/GitPreparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ private void CreateDynamicRepository(string? targetBranch)
{
var gitVersionOptions = this.options.Value;
var authentication = gitVersionOptions.AuthenticationInfo;
if (string.IsNullOrWhiteSpace(gitDirectory))
{
throw new("Dynamic Git repositories should have a path specified");
}
if (!this.fileSystem.DirectoryExists(gitDirectory))
{
CloneRepository(gitVersionOptions.RepositoryInfo.TargetUrl, gitDirectory, authentication);
Expand Down

0 comments on commit e2734f8

Please sign in to comment.