redo.md: explain .do file search-parent-dirs feature.
This commit is contained in:
parent
62fe9a0df5
commit
897c218f85
1 changed files with 19 additions and 2 deletions
|
|
@ -121,12 +121,23 @@ the following order:
|
||||||
- default.do
|
- default.do
|
||||||
|
|
||||||
In all cases, the .do file must be in the same directory as
|
In all cases, the .do file must be in the same directory as
|
||||||
the target file.
|
the target file, or in one of the target's parent
|
||||||
|
directories. For example, if given a target named
|
||||||
|
`../a/b/xtarget.y`, redo will look for a .do file in the
|
||||||
|
following order:
|
||||||
|
|
||||||
|
- $PWD/../a/b/xtarget.y
|
||||||
|
- $PWD/../a/b/default.y.do
|
||||||
|
- $PWD/../a/b/default.do
|
||||||
|
- $PWD/../a/default.y.do
|
||||||
|
- $PWD/../a/default.do
|
||||||
|
- $PWD/../default.y.do
|
||||||
|
- $PWD/../default.do
|
||||||
|
|
||||||
The first matching .do file is executed as a `/bin/sh`
|
The first matching .do file is executed as a `/bin/sh`
|
||||||
script. The .do script is always executed with the current
|
script. The .do script is always executed with the current
|
||||||
working directory set to the directory containing the .do
|
working directory set to the directory containing the .do
|
||||||
file (and thus the target). Because of that rule, the
|
file. Because of that rule, the
|
||||||
following two commands always have exactly identical
|
following two commands always have exactly identical
|
||||||
behaviour:
|
behaviour:
|
||||||
|
|
||||||
|
|
@ -153,6 +164,12 @@ The three arguments passed to the .do script are:
|
||||||
Instead of using $3, the .do script may also write the
|
Instead of using $3, the .do script may also write the
|
||||||
produced data to stdout.
|
produced data to stdout.
|
||||||
|
|
||||||
|
If the .do file is in the same directory as the target, $1
|
||||||
|
and $3 are guaranteed to be simple filenames (with no path
|
||||||
|
component). If the .do file is in a parent directory of
|
||||||
|
the target, $1 and $3 will be relative paths (ie. will
|
||||||
|
contain slashes).
|
||||||
|
|
||||||
redo is designed to update its targets atomically, and only
|
redo is designed to update its targets atomically, and only
|
||||||
if the do script succeeds (ie. returns a zero exit code).
|
if the do script succeeds (ie. returns a zero exit code).
|
||||||
Thus, you should never write directly to the target file,
|
Thus, you should never write directly to the target file,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue