mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-13 04:11:00 +00:00
Fix win_lineinfile to pass integration tests when strict mode is enabled.
This commit is contained in:
@@ -387,8 +387,11 @@ Elseif (Test-Path $dest) {
|
||||
$found = $FALSE;
|
||||
Foreach ($encoding in $sortedlist.GetValueList()) {
|
||||
$preamble = $encoding.GetPreamble();
|
||||
If ($preamble) {
|
||||
Foreach ($i in 0..$preamble.Length) {
|
||||
If ($preamble -and $bom) {
|
||||
Foreach ($i in 0..($preamble.Length - 1)) {
|
||||
If ($i -ge $bom.Length) {
|
||||
break;
|
||||
}
|
||||
If ($preamble[$i] -ne $bom[$i]) {
|
||||
break;
|
||||
}
|
||||
@@ -427,7 +430,7 @@ If ($state -eq "present") {
|
||||
}
|
||||
Else {
|
||||
|
||||
If ($regex -eq $FALSE -and $line -eq $FALSE) {
|
||||
If ($regexp -eq $FALSE -and $line -eq $FALSE) {
|
||||
Fail-Json (New-Object psobject) "one of line= or regexp= is required with state=absent";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user