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")
(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)))
(multiple-value-bind (second minute hour date month year)
(decode-universal-time write-time)
@@ -27,9 +27,18 @@
("mobs" (refresh (maybe-pass #'make-mob-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 ()
(sb-ext:disable-debugger)
(let ((args (rest sb-ext:*posix-argv*)))
(disable-debugger)
(error "foo")
(let ((args (uiop:raw-command-line-arguments)))
(error "foo")
(when (find-string "--fail" args)
(error "Simulated error!"))
(when (find-string "--version" args)
@@ -66,8 +75,6 @@
mobs) "mob" "mob_name"))))
(coerce (data (make-drop-data-source)) 'list)))
(reload-item-data
(filter-map
(lambda (m)