dotnet-version-cli icon indicating copy to clipboard operation
dotnet-version-cli copied to clipboard

Custom scripts

Open h3rmanj opened this issue 4 years ago • 1 comments

With NPM, I can make a script in my package.json named version. This script will run after changing the package.json version, but before creating the git commit. See order of execution in the NPM version docs.

I would like to see something similar here. I don't know how you would go about implementing it though.

In my specific case, I would like to run a script that versions my Helm charts appVersion with the same value as the .csproj version, and then adds the chart to the same git commit. And I'm sure it could be useful in many other scenarios as well.

h3rmanj avatar Jun 23 '21 12:06 h3rmanj

@h3rmanj thanks for the issue.

I agree, it would be really nice to have and the thought have crossed my mind before.

I guess we would have to do something along the lines of allowing you to define both the interpreter and script to execute.

A workaround to achieve something similar we usually do is the following:

  1. We create a script (powershell / bash) that uses dotnet version underneath while disabling commits
  2. We go about updating versions in many csproj files and do other things
  3. Add it all to git and commit + tag

You can see an example of such script over here: https://github.com/rapidcore/rapidcore/blob/master/Bump-Version.ps1

nover avatar Jun 23 '21 14:06 nover