Skip to content

Commit

Permalink
fix: more robust .app dir detection
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
hraban committed Jun 20, 2024
1 parent a387396 commit 1857b26
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@
(defun infoplist (app)
#?"${app}/Contents/Info.plist")

(defun app-p (path)
"Is this path a .app bundle?"
(probe-file (infoplist path)))

(defun sync-icons (from to)
"Remove all icons from TO apps resources, and copy all icons FROM to it"
(destructuring-bind (from-cnts to-cnts) (mapcar #'resources (list from to))
Expand Down Expand Up @@ -171,9 +175,9 @@
(uiop:ensure-pathname from :ensure-absolute t)
(uiop:ensure-pathname to :ensure-absolute t)
(if (uiop:directory-pathname-p from)
(if (str:ends-with-p ".app" (first (last (pathname-directory from))))
(if (app-p from)
(mktrampoline-app from to)
(error "Directory ~A does not end in ‘.app’ is this a Mac app?" from))
(error "Path ~A does appear to be a Mac app (missing Info.plist)" from))
(mktrampoline-bin from to)))


Expand Down

0 comments on commit 1857b26

Please sign in to comment.