mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
Merge pull request #179603 from Artturin/subplacemultiple
This commit is contained in:
commit
79e8669003
@ -913,9 +913,9 @@ substitute ./foo.in ./foo.out \
|
||||
--subst-var someVar
|
||||
```
|
||||
|
||||
### `substituteInPlace` \<file\> \<subs\> {#fun-substituteInPlace}
|
||||
### `substituteInPlace` \<multiple files\> \<subs\> {#fun-substituteInPlace}
|
||||
|
||||
Like `substitute`, but performs the substitutions in place on the file \<file\>.
|
||||
Like `substitute`, but performs the substitutions in place on the files passed.
|
||||
|
||||
### `substituteAll` \<infile\> \<outfile\> {#fun-substituteAll}
|
||||
|
||||
|
@ -771,9 +771,18 @@ substitute() {
|
||||
}
|
||||
|
||||
substituteInPlace() {
|
||||
local fileName="$1"
|
||||
local -a fileNames=()
|
||||
for arg in "$@"; do
|
||||
if [[ "$arg" = "--"* ]]; then
|
||||
break
|
||||
fi
|
||||
fileNames+=("$arg")
|
||||
shift
|
||||
substitute "$fileName" "$fileName" "$@"
|
||||
done
|
||||
|
||||
for file in "${fileNames[@]}"; do
|
||||
substitute "$file" "$file" "$@"
|
||||
done
|
||||
}
|
||||
|
||||
_allFlags() {
|
||||
|
Loading…
Reference in New Issue
Block a user