mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
25 lines
918 B
Common Lisp
25 lines
918 B
Common Lisp
(defpackage :roswell.init.dist
|
|
(:use :cl :roswell.util))
|
|
(in-package :roswell.init.dist)
|
|
|
|
(defun dist (name &rest params)
|
|
(setf name (first params))
|
|
(let ((path (make-pathname :defaults "distinfo" :type "txt")))
|
|
(handler-case
|
|
(unless
|
|
(prog1
|
|
(with-open-file (out path
|
|
:direction :output
|
|
:if-exists nil
|
|
:if-does-not-exist :create)
|
|
(when out
|
|
(format out "name: ~A~%" name)
|
|
(format out "preference: ~A~%" (get-universal-time))
|
|
(format t "~&Successfully generated: ~A~%" path)
|
|
t)))
|
|
(format *error-output* "~&File already exists: ~A~%" path)
|
|
(roswell:quit 1))
|
|
(error (e)
|
|
(format *error-output* "~&~A~%" e)
|
|
(roswell:quit 1)))))
|