Skip to content

Latest commit

 

History

History
339 lines (234 loc) · 6.95 KB

03-usage.md

File metadata and controls

339 lines (234 loc) · 6.95 KB
title layout permalink
Usage
default
usage.html

Usage


Start off by creating a file called Cask in the project root. Use the init command to create a Cask-file automatically, containing boilerplate code.

{% highlight bash %} $ cask init [--dev] {% endhighlight %}

(Use --dev if the project is for package development)

If you are using Cask for your Emacs configuration, add this to your .emacs file:

{% highlight cl %} (require 'cask "~/.cask/cask.el") (cask-initialize) {% endhighlight %}

To install all dependencies, run:

{% highlight bash %} $ cask [install] {% endhighlight %}

This will create a directory called .cask, containing all dependencies.

The commands below execute using the emacs binary. To specify a custom Emacs, use the EMACS environment variable, for example:

{% highlight bash %} $ EMACS="$(evm bin emacs-24.1)" cask command {% endhighlight %}

Commands & Options

Cask's commands and options are briefly described below. For full documentation, use cask help.

Commands


exec

Execute command with correct PATH (see path) and EMACSLOADPATH (see load-path) set up.

{% highlight bash %} $ cask exec echo foo $ cask exec ecukes --script --reporter gangsta $ cask exec ert-runner --pattern performance {% endhighlight %}

help, --help, -h

Show Cask usage information.

{% highlight bash %} $ cask help $ cask -h $ cask --help $ cask --help command {% endhighlight %}

info

Show information about the project, such as name, description and version.

{% highlight bash %} $ cask info {% endhighlight %}

init

Create new Cask-file. If the project is for package development, use the --dev option.

{% highlight bash %} $ cask init # For Emacs configuration $ cask init --dev # For package development {% endhighlight %}

install

This is the default command, which installs all runtime and development dependencies specified in the Cask-file.

{% highlight bash %} $ cask $ cask install {% endhighlight %}

list

List all runtime and development dependencies.

{% highlight bash %} $ cask list {% endhighlight %}

load-path

Print EMACSLOADPATH-friendly string with path to all dependencies to this project.

The exec command includes the output of this command automatically. This means that if the command executed is an Emacs process, there's no hassle with the load-path, just require the dependencies.

{% highlight bash %} $ cask load-path {% endhighlight %}

outdated

Show list of all outdated dependencies. That is dependencies that have a more recent version available for installation.

{% highlight bash %} $ cask outdated {% endhighlight %}

package

Create a -pkg.el file (see http://www.gnu.org/software/emacs/manual/html_node/elisp/Multi_002dfile-Packages.html#Multi_002dfile-Packages).

{% highlight bash %} $ cask package {% endhighlight %}

package-directory

Print path to package directory, that is the path to the directory where all dependencies are installed (.cask/EMACS-VERSION/elpa).

{% highlight bash %} $ cask package-directory {% endhighlight %}

path

Print PATH and prepend path to all directories called bin in this projects dependencies.

For example if this project depends on ecukes, this command will include .cask/EMACS-VERSION/elpa/ecukes-VERSION/bin.

{% highlight bash %} $ cask path {% endhighlight %}

update

Update all dependencies.

{% highlight bash %} $ cask update {% endhighlight %}

upgrade-cask

Upgrade Cask and all its dependencies.

{% highlight bash %} $ cask upgrade-cask {% endhighlight %}

version

Print version of this package.

{% highlight bash %} $ cask version {% endhighlight %}

files

Print list of package files.

{% highlight bash %} $ cask files {% endhighlight %}

build

Byte compile all package files. The .elc files are placed in the same directory as the source file.

{% highlight bash %} $ cask build {% endhighlight %}

clean-elc

Remove byte compiled files generated from the build command.

{% highlight bash %} $ cask clean-elc {% endhighlight %}

link

Handle package links.

{% highlight bash %} $ cask link list # List all links $ cask link ecukes ~/Code/ecukes # Create link to local Ecukes $ cask link delete ecukes # Delete Ecukes link {% endhighlight %}

package

Build a package (.el or .tar) and place in the dist (or specified) directory.

{% highlight bash %} $ cask package $ cask package /path/to/dist {% endhighlight %}

Options


--proxy

Set Emacs proxy for HTTP and HTTPS.

{% highlight bash %} $ cask --proxy "localhost:8888" {% endhighlight %}

--http-proxy

Set Emacs proxy for HTTP.

{% highlight bash %} $ cask --http-proxy "localhost:8888" {% endhighlight %}

--https-proxy

Set Emacs proxy for HTTPS.

{% highlight bash %} $ cask --https-proxy "localhost:8888" {% endhighlight %}

--no-proxy

Set Emacs "no-proxy".

{% highlight bash %} $ cask --no-proxy "work\.com" {% endhighlight %}

--version

Print Cask's version.

{% highlight bash %} $ cask --version {% endhighlight %}

--dev

Perform action in development mode. This option does only take affect for some commands. See resp. command for that information.

{% highlight bash %} $ cask --dev {% endhighlight %}

--debug

Enable debug information.

{% highlight bash %} $ cask --debug {% endhighlight %}

--path

Change default directory to path before executing command.

{% highlight bash %} $ cask --path /path/to {% endhighlight %}

--verbose

Cask tries to hide as much output as possible by default. With this option, all output will show.

{% highlight bash %} $ cask install --verbose {% endhighlight %}