-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.lisp
28 lines (26 loc) · 829 Bytes
/
utils.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(uiop:define-package :kiln/utils
(:documentation "Utilities for writing scripts")
(:use :cl :alexandria :serapeum :named-readtables)
(:use-reexport :kiln/os :kiln/tty)
(:import-from :cffi)
(:import-from :clawk)
(:import-from :kiln/dispatch :invoke-script)
(:import-from :kiln/flags :dbg)
(:local-nicknames
(:interpol :cl-interpol))
(:export
:fields
:cd
:interpolate-escapes
:invoke-script
:invoke-argv))
(in-package :kiln/utils)
(in-readtable :interpol-syntax)
(defun interpolate-escapes (string)
(let ((interpol:*inner-delimiters* nil))
(assure string
(with-input-from-string (in (string+ #\" string #\"))
(interpol:interpol-reader in nil nil :recursive-p nil)))))
(defun invoke-argv (argv)
"Invoke another script."
(apply #'invoke-script (first argv) (rest argv)))