Skip to content

Commit

Permalink
Merge pull request #10034 from bacchanalia/7986-docs-script-list-bin
Browse files Browse the repository at this point in the history
Add docs for list-bin support of scripts
  • Loading branch information
mergify[bot] authored May 21, 2024
2 parents 2658ac6 + 0f1e17d commit 93f4c0d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ A cabal command target can take any of the following forms:
component of which the given filepath is a part of will be built.

- A script target: ``path/to/script``, which specifies the path to a script
file. This is supported by ``build``, ``repl``, ``run``, and ``clean``.
Script targets are not part of a package.
file. This is supported by ``build``, ``repl``, ``run``, ``list-bin``, and
``clean``. Script targets are not part of a package.

.. _command-group-global:

Expand Down Expand Up @@ -970,6 +970,14 @@ We can also scope to test suite targets as they produce binaries.
$ cabal list-bin cabal-install:unit-tests
/.../dist-newstyle/.../unit-tests/unit-tests

It can also be used to display the location of the cached executable for a
cabal script.

::

$ cabal list-bin path/to/script
$XDG_CACHE_HOME/cabal/script-builds/.../bin/script

Note that ``cabal list-bin`` will print the executables' location, but
will not make sure that these executables actually exist (i.e., have
been successfully built). In order to determine the correct location,
Expand Down Expand Up @@ -1140,6 +1148,9 @@ The executable is cached under the cabal directory, and can be pre-built with
``cabal build path/to/script`` and the cache can be removed with
``cabal clean path/to/script``.

The location of the cached executable can be displayed with
``cabal list-bin path/to/script``.

A note on targets: Whenever a command takes a script target and it matches the
name of another target, the other target is preferred. To load the script
instead pass it as an explicit path: ./script
Expand Down

0 comments on commit 93f4c0d

Please sign in to comment.