Make application more portable

This commit is contained in:
2026-01-06 16:23:04 -05:00
parent 325ae98cab
commit b234753eb8

View File

@@ -5,7 +5,7 @@
(defparameter *chronostory-gacha-url-format "https://chronostory.onrender.com/api/gacha-items?gachaId=~a") (defparameter *chronostory-gacha-url-format "https://chronostory.onrender.com/api/gacha-items?gachaId=~a")
(defun print-version-information () (defun print-version-information ()
(let* ((program-name (car sb-ext:*posix-argv*)) (let* ((program-name (car (uiop:raw-command-line-arguments)))
(write-time (file-write-date program-name))) (write-time (file-write-date program-name)))
(multiple-value-bind (second minute hour date month year) (multiple-value-bind (second minute hour date month year)
(decode-universal-time write-time) (decode-universal-time write-time)
@@ -27,9 +27,18 @@
("mobs" (refresh (maybe-pass #'make-mob-data-source maybe-file-path))) ("mobs" (refresh (maybe-pass #'make-mob-data-source maybe-file-path)))
("spawns" (refresh (maybe-pass #'make-spawn-data-source maybe-file-path))))) ("spawns" (refresh (maybe-pass #'make-spawn-data-source maybe-file-path)))))
(defun disable-debugger ()
(setf *debugger-hook*
(lambda (condition hook)
(declare (ignore hook))
(format t "Unhandled error: ~a~%" condition)
(uiop:quit 1))))
(defun main () (defun main ()
(sb-ext:disable-debugger) (disable-debugger)
(let ((args (rest sb-ext:*posix-argv*))) (error "foo")
(let ((args (uiop:raw-command-line-arguments)))
(error "foo")
(when (find-string "--fail" args) (when (find-string "--fail" args)
(error "Simulated error!")) (error "Simulated error!"))
(when (find-string "--version" args) (when (find-string "--version" args)
@@ -66,8 +75,6 @@
mobs) "mob" "mob_name")))) mobs) "mob" "mob_name"))))
(coerce (data (make-drop-data-source)) 'list))) (coerce (data (make-drop-data-source)) 'list)))
(reload-item-data (reload-item-data
(filter-map (filter-map
(lambda (m) (lambda (m)