Skip to content

Commit 1362694

Browse files
committed
Add files.line tests for strings that require quoting.
1 parent 5024e59 commit 1362694

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"args": ["some file", "match line"],
3+
"kwargs": {
4+
"replace": "replace line",
5+
"flags": "abc"
6+
},
7+
"facts": {
8+
"find_in_file": {
9+
"some file": {
10+
"^.*match line.*$": null
11+
}
12+
}
13+
},
14+
"commands": [
15+
"if [ -f 'some file' ]; then (grep '^.*match line.*$' 'some file' && sed -i.a-timestamp 's/^.*match line.*$/replace line/abc' 'some file' && rm -f 'some file.a-timestamp') 2> /dev/null || echo 'replace line' >> 'some file'; else echo 'replace line' >> 'some file'; fi"
16+
],
17+
"idempotent": false
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"args": ["somefile", "match line"],
3+
"facts": {
4+
"find_in_file": {
5+
"somefile": {
6+
"^.*match line.*$": []
7+
}
8+
}
9+
},
10+
"commands": [
11+
"echo 'match line' >> somefile"
12+
],
13+
"idempotent": false
14+
}

0 commit comments

Comments
 (0)