...
 
Commits (3)
......@@ -14,3 +14,6 @@ build:
stage: build
script:
- make build
artifacts:
paths:
- bookshops
......@@ -3,7 +3,7 @@
|#
(asdf:defsystem "bookshops"
:version "0.1.0"
:version "0.1.1"
:author "vindarel"
:license "GPL3"
:depends-on (
......@@ -59,6 +59,11 @@
;; (subpathname *load-pathname* "README.md"))
:in-order-to ((test-op (test-op "bookshops-test"))))
;; from 108M, 0.04s startup time to 24M, 0.37s.
#+sb-core-compression
(defmethod asdf:perform ((o asdf:image-op) (c asdf:system))
(uiop:dump-image (asdf:output-file o c) :executable t :compression t))
(asdf:defsystem "bookshops/gui"
:version "0.1.0"
:author "vindarel"
......
......@@ -187,13 +187,32 @@
(format t "Argument error: ~a~&" (opts:option c))
(uiop:quit 1))
(defun version ()
"Return the version as in the asd plus the current commit id."
(let ((version (asdf/component:component-version (asdf:find-system :bookshops)))
(directory (asdf:system-source-directory :bookshops)))
(or (ignore-errors
(uiop:with-current-directory (directory)
(multiple-value-bind (current-commit)
(uiop:run-program (list "git" "describe" "--always")
:output '(:string :stripped t))
(concatenate 'string
version
(format nil "-~a" current-commit)))))
version)))
(defun main ()
(opts:define-opts
(:name :help
:description "print this help and exit."
:short #\h
:long "help")
(:name :help
:description "print this help and exit."
:short #\h
:long "help")
(:name :version
:description "print the version number and exit."
:short #\v
:long "version")
(:name :interactive
:description "enter the interactive prompt."
......@@ -204,6 +223,11 @@
(handler-bind ((error #'handle-parser-error))
(opts:get-opts))
(if (getf options :version)
(progn
(format t "~a~&" (version))
(uiop:quit)))
(if (getf options :help)
(progn
(opts:describe)
......