Skip to content
Permalink
Browse files

cli: add --install-deps command

Installs a system's dependencies into the local .dependency directory

Usage:
  $ qi --install-deps path/to/system.asd
  • Loading branch information...
dunn committed Oct 23, 2016
1 parent 921b71c commit c9d70070a8bb3e58118d876096c7b54f978eca17
Showing with 48 additions and 20 deletions.
  1. +11 −4 README.org
  2. +3 −5 bin/qi
  3. +17 −6 docs/qi.html
  4. +17 −5 src/cli.lisp
@@ -81,6 +81,12 @@ View the HTML version of this documentation [[http://codyreichert.github.io/qi/]
* (qi:install :myproject)
#+END_SRC

You can also install project dependencies from the command-line:

#+BEGIN_SRC sh
qi --install-deps path/to/myproject.asd
#+END_SRC

Qi take's care of any transitive dependencies and will let you know
of any that it could /not/ install. In a case where Qi can not
install some dependencies, add direct links to those packages in
@@ -206,12 +212,13 @@ View the HTML version of this documentation [[http://codyreichert.github.io/qi/]
λ qi -h
Qi - A simple, open, free package manager for Common Lisp.

Usage: qi [-h|--help] [-u|--upgrade] [-i|--install PACKAGE] [Free-Args]
Usage: qi [-h|--help] [-u|--upgrade] [-i|--install PACKAGE] [-d|--install-deps ASD-FILE] [Free-Args]

Available options:
-h, --help Print this help menu.
-u, --upgrade Upgrade Qi (pull the latest from git)
-i, --install PACKAGE Install a package from Qi (global by default)
-h, --help Print this help menu.
-u, --upgrade Upgrade Qi (pull the latest from git)
-i, --install PACKAGE Install a package from Qi (global by default)
-d, --install-deps ASD-FILE Install dependencies locally for the specified system

Issues https://github.com/CodyReichert/qi
#+END_SRC
8 bin/qi
@@ -1,10 +1,8 @@
#!/bin/bash

set -e

cd "$(dirname ${BASH_SOURCE[0]})/../"
QI_PREFIX=${QI_PREFIX:-"$(dirname ${BASH_SOURCE[0]})/.."}

sbcl --noinform --non-interactive \
--load init.lisp \
--load src/cli.lisp \
--load "$QI_PREFIX"/init.lisp \
--load "$QI_PREFIX"/src/cli.lisp \
--end-toplevel-options "$@"
@@ -4,7 +4,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>README</title>
<!-- 2016-10-22 Sat 20:30 -->
<!-- 2016-10-24 Mon 17:59 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="generator" content="Org-mode" />
@@ -314,6 +314,16 @@ <h4 id="orgheadline2"><span class="section-number-4">1.2.1</span> Using Qi for a
</pre>
</div>
<p>
You can also install project dependencies from the command-line:
</p>
<div class="org-src-container">
<pre class="src src-sh">qi --install-deps path/to/myproject.asd
</pre>
</div>
<p>
Qi take's care of any transitive dependencies and will let you know
of any that it could <i>not</i> install. In a case where Qi can not
@@ -548,12 +558,13 @@ <h3 id="orgheadline13"><span class="section-number-3">1.5</span> CLI</h3>
<pre class="src src-sh">&#955; qi -h
Qi - A simple, open, free package manager for Common Lisp.
Usage: qi [-h|--help] [-u|--upgrade] [-i|--install PACKAGE] [Free-Args]
Usage: qi [-h|--help] [-u|--upgrade] [-i|--install PACKAGE] [-d|--install-deps ASD-FILE] [Free-Args]
Available options:
-h, --help Print this help menu.
-u, --upgrade Upgrade Qi (pull the latest from git)
-i, --install PACKAGE Install a package from Qi (global by default)
-h, --help Print this help menu.
-u, --upgrade Upgrade Qi (pull the latest from git)
-i, --install PACKAGE Install a package from Qi (global by default)
-d, --install-deps ASD-FILE Install dependencies locally for the specified system
Issues https://github.com/CodyReichert/qi
</pre>
@@ -630,7 +641,7 @@ <h3 id="orgheadline18"><span class="section-number-3">1.10</span> License</h3>
</div>
</div>
<div id="postamble" class="status">
<p class="date">Created: 2016-10-22 Sat 20:30</p>
<p class="date">Created: 2016-10-24 Mon 17:59</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
@@ -29,8 +29,13 @@
:short #\i
:long "install"
:arg-parser #'identity
:command "install"
:meta-var "PACKAGE"))
:meta-var "PACKAGE")
(:name :install-deps
:description "Install local dependencies for the specified system"
:short #\d
:long "install-deps"
:arg-parser #'identity
:meta-var "ASD-FILE"))


(defun unknown-option (cond)
@@ -44,8 +49,13 @@
,@body)))


;;; Qi Install ($ qi --install [package] / $ qi -i [package]) internals
;;; Qi install-deps ($ qi --install-deps project.asd)
(defun opt-install-deps (input)
"Install the dependencies locally for the system definition file provided as INPUT."
(load input)
(qi:install (pathname-name input)))

;;; Qi Install ($ qi --install [package] / $ qi -i [package]) internals
(defun opt-install (opt)
"Install a package to Qi global package directory. The package will be available
in all future lisp sessions."
@@ -106,6 +116,8 @@ in all future lisp sessions."
:usage-of "qi"
:args "[Free-Args]"))
(when-option (options :upgrade)
(run-qi-upgrade))
(run-qi-upgrade))
(when-option (options :install)
(opt-install (getf options :install))))
(opt-install (getf options :install)))
(when-option (options :install-deps)
(opt-install-deps (getf options :install-deps))))

0 comments on commit c9d7007

Please sign in to comment.
You can’t perform that action at this time.