Skip to content

Commit 39c4333

Browse files
committed
Fix awk regex escaping in deploy workflow
Corrected awk regular expressions in the deploy-to-wporg GitHub Actions workflow to remove unnecessary backslashes and ensure proper matching and replacement of PHP code patterns.
1 parent 6bef6df commit 39c4333

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/deploy-to-wporg.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,21 @@ jobs:
192192
BEGIN { changed=0 }
193193
{
194194
line=$0
195-
if (line ~ /protected[[:space:]]*\(NodeDefinition[[:space:]]*\&[[:space:]]*ParentNodeDefinitionInterface\)[[:space:]]*\|[[:space:]]*null[[:space:]]*\$parent[[:space:]]*=.*/) {
195+
if (line ~ /protected[[:space:]]*\(NodeDefinition[[:space:]]*&[[:space:]]*ParentNodeDefinitionInterface\)[[:space:]]*\|[[:space:]]*null[[:space:]]*\$parent[[:space:]]*=.*/) {
196196
ind=indent_of(line)
197-
line=ind "protected \\$parent = null;"
197+
line=ind "protected $parent = null;"
198198
print line
199199
changed=1
200200
next
201201
}
202-
if (line ~ /public[[:space:]]+function[[:space:]]+setParent\(\(NodeDefinition[[:space:]]*\&[[:space:]]*ParentNodeDefinitionInterface\)[[:space:]]*\|[[:space:]]*null[[:space:]]*\$parent\)[[:space:]]*:[[:space:]]*static/) {
202+
if (line ~ /public[[:space:]]+function[[:space:]]+setParent\(\(NodeDefinition[[:space:]]*&[[:space:]]*ParentNodeDefinitionInterface\)[[:space:]]*\|[[:space:]]*null[[:space:]]*\$parent\)[[:space:]]*:[[:space:]]*static/) {
203203
ind=indent_of(line)
204-
line=ind "public function setParent(\\$parent): static"
204+
line=ind "public function setParent($parent): static"
205205
print line
206206
changed=1
207207
next
208208
}
209-
if (line ~ /public[[:space:]]+function[[:space:]]+end\(\)[[:space:]]*:[[:space:]]*NodeDefinition[[:space:]]*\&[[:space:]]*ParentNodeDefinitionInterface/) {
209+
if (line ~ /public[[:space:]]+function[[:space:]]+end\(\)[[:space:]]*:[[:space:]]*NodeDefinition[[:space:]]*&[[:space:]]*ParentNodeDefinitionInterface/) {
210210
ind=indent_of(line)
211211
line=ind "public function end()"
212212
print line

0 commit comments

Comments
 (0)