Skip to content

Commit

Permalink
Factor abort out of the pkg-new
Browse files Browse the repository at this point in the history
  • Loading branch information
fare committed Oct 24, 2023
1 parent f2ebf8a commit dbb0fda
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/tools/gxpkg.ss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
pkg-retag
pkg-plist pkg-dependents pkg-dependents*)

;; TODO: move that to general-purpose runtime support, and
;; have it throw an exception that is caught by the bottom runtime handler.
(def (abort msg)
(eprintf "~a\n" msg)
(exit 2))

(def (main . args)
(def local-flag
(flag 'local "-l" "--local"
Expand Down Expand Up @@ -342,8 +348,7 @@
(def (pkg-new package-prefix package-name maybe-link)
(def prefix (or package-prefix
(getenv "USER" #f)
(begin (eprintf "Package prefix not specified with -p or --package, and USER not defined\n")
(exit 2))))
(abort "Package prefix not specified with -p or --package, and USER not defined")))
(def name (or package-name
(path-strip-directory (path-normalize* (current-directory)))))
(def (create-template file template . args)
Expand Down

0 comments on commit dbb0fda

Please sign in to comment.