Skip to content
Permalink
Browse files

Switch to using DEPLOY:DEPLOYED-P

  • Loading branch information
Shinmera committed Mar 5, 2020
1 parent 1ffcae5 commit 7164f8988780c8b167c6c662df56902e5e6cb7fa
Showing with 11 additions and 14 deletions.
  1. +1 −1 alloy/renderer.lisp
  2. +1 −1 asset-pool.lisp
  3. +1 −2 deploy.lisp
  4. +0 −1 package.lisp
  5. +2 −2 steam.lisp
  6. +6 −7 toolkit.lisp
@@ -10,7 +10,7 @@
())

(defmethod org.shirakumo.alloy.renderers.opengl.msdf:fontcache-directory ((renderer renderer))
(if trial:*standalone*
(if (deploy:deployed-p)
(pathname-utils:subdirectory (deploy:data-directory) "pool" "font-cache")
(call-next-method)))

@@ -7,7 +7,7 @@
(in-package #:org.shirakumo.fraf.trial)

(defmethod coerce-base ((system symbol))
(if *standalone*
(if (deploy:deployed-p)
(pathname-utils:subdirectory (deploy:data-directory) "pool" (string system))
(pathname-utils:subdirectory (asdf:system-source-directory system) "data")))

@@ -23,8 +23,7 @@
(deploy:copy-directory-tree
(coerce-base base)
(pathname-utils:subdirectory directory "pool" (string base-name))
:copy-root NIL))))
(setf *standalone* T))
:copy-root NIL)))))

(deploy:define-hook (:build trial) ()
(v:remove-global-controller))
@@ -724,7 +724,6 @@
#:with-new-value-restart
#:with-cleanup-on-failure
#:acquire-lock-with-starvation-test
#:*standalone*
#:standalone-error-handler
#:standalone-logging-handler
#:make-thread
@@ -20,12 +20,12 @@
(defmethod initialize-instance :after ((main main) &key app-id)
(handler-bind ((steam:initialization-failed
(lambda (e)
(when trial:*standalone*
(when (deploy:deployed-p)
(if (steam-required-p main)
(invoke-restart 'steam:restart)
(invoke-restart 'ignore))))))
(when (or (steam-required-p main)
trial:*standalone*)
(deploy:deployed-p))
(with-simple-restart (ignore "Ignore the steamworks failure.")
(make-instance 'steam:steamworks-client :app-id app-id)))))

@@ -219,18 +219,17 @@
(return NIL))
(bt:thread-yield))))

(defvar *standalone* NIL)
(defun standalone-error-handler (err)
(when *standalone*
(when (deploy:deployed-p)
(v:error :trial err)
(v:fatal :trial "Encountered unhandled error in ~a, bailing." (bt:current-thread))
(if (and (uiop:getenv "DEPLOY_DEBUG_BOOT")
(string/= "" (uiop:getenv "DEPLOY_DEBUG_BOOT")))
(invoke-debugger err)
(deploy:quit))))
(cond ((and (uiop:getenv "DEPLOY_DEBUG_BOOT")
(string/= "" (uiop:getenv "DEPLOY_DEBUG_BOOT")))
(invoke-debugger err)
(deploy:quit)))))

(defun standalone-logging-handler ()
(when *standalone*
(when (deploy:deployed-p)
(let ((log (uiop:getenv "TRIAL_LOGFILE")))
(unless (and log (string/= "" log))
(setf log (merge-pathnames "trial.log" (or (uiop:argv0) (user-homedir-pathname)))))

0 comments on commit 7164f89

Please sign in to comment.
You can’t perform that action at this time.