Skip to content

Commit

Permalink
implement lisp script impl
Browse files Browse the repository at this point in the history
  • Loading branch information
snmsts committed Jan 13, 2024
1 parent 5185d22 commit 3fc8627
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/script/impl/main.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(uiop:define-package :roswell2.script.impl/main
(:use :cl
:roswell-bin/util
:roswell-bin/config
:roswell2/main
:roswell2.cmd.script
:roswell2.cmd.run)
(:nicknames :roswell2.script.impl))
(in-package :roswell2.script.impl/main)

(defvar *command-class* 'roswell2/clingon.extensions::command-without-version)

(defun sub-commands ())

(defun options ())

(defun handler (cmd)
(let* ((args (clingon:command-arguments cmd))
(impl (first args))
(to (ensure-directories-exist
(make-pathname
:defaults (bin-dir)
:name impl
:type nil))))
(message :script-impl "script impl ~S" args)
(with-open-file (o to :direction :output :if-exists :supersede)
(format o "~{~A~%~}"
`("#!/bin/sh"
"#|-*- mode:lisp -*-|#"
"#|"
,(format nil "exec lisp run -L ~A --native -- \"$@\"" impl)
"|#")))))
8 changes: 8 additions & 0 deletions lib/script/impl/roswell2.script.impl.asd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(defsystem "roswell2.script.impl"
:long-name "impl"
:class :package-inferred-system
:author "SANO Masatoshi"
:description "install script to run implementation"
:license "MIT"
:depends-on (:roswell2.script.impl/main))

0 comments on commit 3fc8627

Please sign in to comment.