Commit 85931c6f authored by Eric Timmons's avatar Eric Timmons
Browse files

cli less work: bundle init

parent 22d69ec1
...@@ -5,17 +5,14 @@ ...@@ -5,17 +5,14 @@
(uiop:define-package #:clpm-cli/commands/bundle/init (uiop:define-package #:clpm-cli/commands/bundle/init
(:use #:cl (:use #:cl
#:clpm/bundle
#:clpm-cli/commands/bundle/common #:clpm-cli/commands/bundle/common
#:clpm-cli/common-args #:clpm-cli/common-args
#:clpm-cli/interface-defs #:clpm-cli/interface-defs)
#:clpm/log) (:import-from #:adopt)
(:import-from #:adopt)) (:import-from #:clpm))
(in-package #:clpm-cli/commands/bundle/init) (in-package #:clpm-cli/commands/bundle/init)
(setup-logger)
(defparameter *option-bundle-init-asd* (defparameter *option-bundle-init-asd*
(adopt:make-option (adopt:make-option
:bundle-init-asds :bundle-init-asds
...@@ -37,7 +34,6 @@ ...@@ -37,7 +34,6 @@
(define-cli-command (("bundle" "init") *bundle-init-ui*) (args options) (define-cli-command (("bundle" "init") *bundle-init-ui*) (args options)
(declare (ignore args)) (declare (ignore args))
(let* ((clpmfile-pathname (bundle-clpmfile-pathname)) (let ((asds (gethash :bundle-init-asds options)))
(asds (gethash :bundle-init-asds options))) (clpm:bundle-init :asds asds)
(bundle-init clpmfile-pathname :asds asds)
t)) t))
...@@ -91,10 +91,10 @@ bound to PN's folder." ...@@ -91,10 +91,10 @@ bound to PN's folder."
(lockfile-pathname (clpmfile-lockfile-pathname clpmfile))) (lockfile-pathname (clpmfile-lockfile-pathname clpmfile)))
(load-lockfile lockfile-pathname))) (load-lockfile lockfile-pathname)))
(defun bundle-init (clpmfile-pathname &key (if-exists :error) asds) (defun bundle-init (&key clpmfile (if-exists :error) asds)
(with-standard-io-syntax (with-standard-io-syntax
(let ((*print-case* :downcase)) (let ((*print-case* :downcase))
(with-open-file (s clpmfile-pathname :direction :output :if-exists if-exists) (with-open-file (s (clpmfile-pathname clpmfile) :direction :output :if-exists if-exists)
(write-string ";;; -*- Mode: common-lisp; -*-" s) (write-string ";;; -*- Mode: common-lisp; -*-" s)
(terpri s) (terpri s)
(prin1 '(:api-version "0.3") s) (prin1 '(:api-version "0.3") s)
...@@ -107,7 +107,7 @@ bound to PN's folder." ...@@ -107,7 +107,7 @@ bound to PN's folder."
(dolist (asd asds) (dolist (asd asds)
(prin1 `(:asd ,asd) s) (prin1 `(:asd ,asd) s)
(terpri s))))) (terpri s)))))
clpmfile-pathname) (clpmfile-pathname clpmfile))
(defun bundle-install (clpmfile-designator &key (validate (constantly t)) no-resolve) (defun bundle-install (clpmfile-designator &key (validate (constantly t)) no-resolve)
"Given a clpmfile instance, install all releases from its lock file, creating "Given a clpmfile instance, install all releases from its lock file, creating
......
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
#:clpm/update #:clpm/update
#:clpm/version) #:clpm/version)
;; From bundle ;; From bundle
(:export #:bundle-exec) (:export #:bundle-exec
#:bundle-init)
;; From client ;; From client
(:export #:client-asd-pathname) (:export #:client-asd-pathname)
;; From config ;; From config
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment