Skip to content

Commit

Permalink
feat: print help on NotFoundException (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
saintedlama committed Jan 30, 2022
1 parent c27cf07 commit 7cc1ddc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Versionize/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ public static int Main(string[] args)
{
return CommandLineUI.Exit(e.Message, 1);
}
catch (LibGit2Sharp.NotFoundException e)
{
return CommandLineUI.Exit($@"
Error: LibGit2Sharp.NotFoundException
This is most likely caused by running versionize against a git repository cloned with depth --1.
In case you're using the actions/checkout@v2 in github actions you could specify fetch-depth: '1'.
For more detail see https://github.com/actions/checkout
Exception detail:
{e}", 1);
}
}

private static string GetVersion() => typeof(Program).Assembly.GetName().Version.ToString();
Expand Down

0 comments on commit 7cc1ddc

Please sign in to comment.