added a simple 'koch branchdone' command to speed up my workflow (#17563)

This commit is contained in:
Andreas Rumpf 2021-03-29 12:42:34 +02:00 • committed by GitHub
commit ab57e7f244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -664,6 +664,13 @@ proc showHelp() =
quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)), quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)),
CompileDate, CompileTime], QuitSuccess) CompileDate, CompileTime], QuitSuccess)
proc branchDone() =
let thisBranch = execProcess("git symbolic-ref --short HEAD").strip()
if thisBranch != "devel" and thisBranch != "":
exec("git checkout devel")
exec("git branch -D " & thisBranch)
exec("git pull --rebase")
when isMainModule: when isMainModule:
var op = initOptParser() var op = initOptParser()
var var
@ -722,6 +729,7 @@ when isMainModule:
let suffix = if latest: HeadHash else: FusionStableHash let suffix = if latest: HeadHash else: FusionStableHash
exec("nimble install -y fusion@$#" % suffix) exec("nimble install -y fusion@$#" % suffix)
of "ic": icTest(op.cmdLineRest) of "ic": icTest(op.cmdLineRest)
of "branchdone": branchDone()
else: showHelp() else: showHelp()
break break
of cmdEnd: break of cmdEnd: break