Skip to content
Snippets Groups Projects
Unverified Commit a0a820f9 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Add docs for list-bin support of scripts (#10077)


closes #7986

(cherry picked from commit 0f1e17df)

Co-authored-by: default avatarZoe Zuser <zoe@mzero.dev>
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent e9de0dd7
No related branches found
No related tags found
No related merge requests found
...@@ -245,8 +245,8 @@ A cabal command target can take any of the following forms: ...@@ -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. 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 - A script target: ``path/to/script``, which specifies the path to a script
file. This is supported by ``build``, ``repl``, ``run``, and ``clean``. file. This is supported by ``build``, ``repl``, ``run``, ``list-bin``, and
Script targets are not part of a package. ``clean``. Script targets are not part of a package.
.. _command-group-global: .. _command-group-global:
...@@ -963,6 +963,14 @@ We can also scope to test suite targets as they produce binaries. ...@@ -963,6 +963,14 @@ We can also scope to test suite targets as they produce binaries.
$ cabal list-bin cabal-install:unit-tests $ cabal list-bin cabal-install:unit-tests
/.../dist-newstyle/.../unit-tests/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 Note that ``cabal list-bin`` will print the executables' location, but
will not make sure that these executables actually exist (i.e., have will not make sure that these executables actually exist (i.e., have
been successfully built). In order to determine the correct location, been successfully built). In order to determine the correct location,
...@@ -1133,6 +1141,9 @@ The executable is cached under the cabal directory, and can be pre-built with ...@@ -1133,6 +1141,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 build path/to/script`` and the cache can be removed with
``cabal clean path/to/script``. ``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 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 name of another target, the other target is preferred. To load the script
instead pass it as an explicit path: ./script instead pass it as an explicit path: ./script
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment