improve version numbering
parent
bbf7c699c9
commit
b60ddedc43
@ -0,0 +1 @@
|
|||||||
|
1454182306
|
@ -1,3 +1,18 @@
|
|||||||
#lang racket/base
|
#lang racket/base
|
||||||
(provide default-version)
|
(require racket/file racket/format racket/runtime-path)
|
||||||
(define default-version "1.0")
|
(provide pollen:version)
|
||||||
|
(define-runtime-path ts-file "ts.rktd")
|
||||||
|
(define ts (file->value ts-file))
|
||||||
|
|
||||||
|
(define (convert str)
|
||||||
|
(apply string-append
|
||||||
|
(for/list ([c (in-string str)])
|
||||||
|
(define c-int (char->integer c))
|
||||||
|
(~a (integer->char (+ c-int (if (<= (char->integer #\0) c-int (char->integer #\9))
|
||||||
|
(- (char->integer #\a) (char->integer #\0))
|
||||||
|
10)))))))
|
||||||
|
|
||||||
|
(define (pollen:version)
|
||||||
|
(define major-version 1)
|
||||||
|
(define minor-version (convert (~r ts #:base 26)))
|
||||||
|
(format "~a.~a" major-version minor-version))
|
Loading…
Reference in New Issue