Skip to content

Instantly share code, notes, and snippets.

@regme
Created November 6, 2020 13:28
Show Gist options
  • Save regme/f797eac6a93c35256211baff86870307 to your computer and use it in GitHub Desktop.
Save regme/f797eac6a93c35256211baff86870307 to your computer and use it in GitHub Desktop.
Latest RC number
$rc = $(git branch --all| Select-String "/rc-\d+$" | sort { [int]($_ -replace '\D+') } | select -ExpandProperty Line -Last 1) -replace '\D+'
@regme
Copy link
Author

regme commented Nov 6, 2020

$rc = $("$(git branch -r | Select-String "rc-")".trim().split() | Where-Object {$}) -replace "\D+" | Sort {$ -as [int]} | Select-Object -Last 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment