Version logic extended

This commit is contained in:
2026-08-13 17:18:31 +02:00
parent 73084e69d9
commit 135938f75a
3 changed files with 23 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
(define collection "git-cli") (define collection "git-cli")
(define pkg-desc "Command-line-like Git operations for Racket, interface to the git cli command") (define pkg-desc "Command-line-like Git operations for Racket, interface to the git cli command")
(define version "0.3.18") (define version "0.3.19")
(define pkg-authors '("Hans Dijkema")) (define pkg-authors '("Hans Dijkema"))
(define license 'MIT) (define license 'MIT)
+20 -2
View File
@@ -30,6 +30,7 @@
git-help git-help
git-version git-version
git-new-version git-new-version
git-next-version
current-git-authentication-handler current-git-authentication-handler
exn:fail:git-auth? exn:fail:git-auth?
exn:fail:git-auth-command exn:fail:git-auth-command
@@ -589,14 +590,31 @@
; result : The new version as a list containing major, minor and patch. ; result : The new version as a list containing major, minor and patch.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (cmd-git-new-version args) (define (cmd-git-new-version args)
(when(null? args) (when (null? args)
(error "git-new-version expects 'maj, 'major, 'min, 'minor or 'patch")) (error "git-new-version expects 'maj, 'major, 'min, 'minor or 'patch"))
(let ((kind (car args))) (let ((kind (car args)))
(git-next-version kind ".") (info-next-version kind ".")
(git-version))) (git-version)))
(hash-set! git-commands 'new-version cmd-git-new-version) (hash-set! git-commands 'new-version cmd-git-new-version)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; goal : Implement the registered next-version command.
; pre : args must be empty.
; post : The version definition in info.rkt has been updated.
; result : The new patch version.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (git-next-version . args)
(cmd-git-next-version args))
(define (cmd-git-next-version args)
(unless (null? args)
(error "git-next-version expexts no arguments"))
(let ((kind 'patch))
(info-next-version kind ".")
(git-version)))
(hash-set! git-commands 'next-version cmd-git-next-version)
+2 -2
View File
@@ -6,7 +6,7 @@
(provide info-version (provide info-version
set-info-version! set-info-version!
git-next-version info-next-version
) )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -74,7 +74,7 @@
; post : The version definition in info.rkt has been updated. ; post : The version definition in info.rkt has been updated.
; result : #t after writing the new version. ; result : #t after writing the new version.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (git-next-version kind . dir*) (define (info-next-version kind . dir*)
(let ((dir (if (null? dir*) (let ((dir (if (null? dir*)
"." "."
(car dir*)))) (car dir*))))