Skip to content

Commit b04ab30

Browse files
bacchanaliamergify[bot]
authored andcommitted
Add docs for list-bin support of scripts
closes #7986 (cherry picked from commit 0f1e17d)
1 parent fc9de61 commit b04ab30

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/cabal-commands.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ A cabal command target can take any of the following forms:
245245
component of which the given filepath is a part of will be built.
246246

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

251251
.. _command-group-global:
252252

@@ -963,6 +963,14 @@ We can also scope to test suite targets as they produce binaries.
963963
$ cabal list-bin cabal-install:unit-tests
964964
/.../dist-newstyle/.../unit-tests/unit-tests
965965

966+
It can also be used to display the location of the cached executable for a
967+
cabal script.
968+
969+
::
970+
971+
$ cabal list-bin path/to/script
972+
$XDG_CACHE_HOME/cabal/script-builds/.../bin/script
973+
966974
Note that ``cabal list-bin`` will print the executables' location, but
967975
will not make sure that these executables actually exist (i.e., have
968976
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
11331141
``cabal build path/to/script`` and the cache can be removed with
11341142
``cabal clean path/to/script``.
11351143

1144+
The location of the cached executable can be displayed with
1145+
``cabal list-bin path/to/script``.
1146+
11361147
A note on targets: Whenever a command takes a script target and it matches the
11371148
name of another target, the other target is preferred. To load the script
11381149
instead pass it as an explicit path: ./script

0 commit comments

Comments
 (0)