-
-
Notifications
You must be signed in to change notification settings - Fork 426
Open
Description
Describe the bug
When before
and after
are both True
and line
is specified and is not found, files.block
should prepend contents
but instead appends them.
To Reproduce
echo bar > test.txt
pyinfra @local files.block path="test.txt" content="block contents" present=True after=True before=True
cat test.txt
bar
# BEGIN PYINFRA BLOCK
block contents
# END PYINFRA BLOCK
Expected behavior
test.txt
should contain
# BEGIN PYINFRA BLOCK
block contents
# END PYINFRA BLOCK
bar
Meta
- Include output of
pyinfra --support
.
System: Darwin
Platform: macOS-14.7.7-arm64-arm-64bit
Release: 23.6.0
Machine: arm64
pyinfra: v3.4.1
Executable: /Users/.../.virtualenvs/pyinfra-dev/bin/pyinfra
Python: 3.12.7 (CPython, Clang 16.0.0 (clang-1600.0.26.4))
- How was pyinfra installed (source/pip)?
pip install -e '.[dev]'
Metadata
Metadata
Assignees
Labels
No labels