Skip to content

Commit c3b0fd1

Browse files
made it POSIX compatible.
1 parent 066d91f commit c3b0fd1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

codemods/regexp-to-arkregex/workflow.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ nodes:
4949
5050
# Use find to search for .ts and .tsx files, excluding node_modules, .git, dist, build
5151
if find "$dir" -type f \( -name "*.ts" -o -name "*.tsx" \) \
52-
-not -path "*/node_modules/*" \
53-
-not -path "*/.git/*" \
54-
-not -path "*/dist/*" \
55-
-not -path "*/build/*" \
56-
-exec grep -l "from [\"']${package}[\"']" {} \; 2>/dev/null | head -1 | grep -q .; then
52+
! -path "*/node_modules/*" \
53+
! -path "*/.git/*" \
54+
! -path "*/dist/*" \
55+
! -path "*/build/*" \
56+
-exec grep -l "from [\"']${package}[\"']" {} \; 2>/dev/null | head -n 1 | grep -q .; then
5757
return 0 # Found import
5858
else
5959
return 1 # No import found
@@ -99,11 +99,11 @@ nodes:
9999
# Find all package.json files in the target directory
100100
# Exclude node_modules and common build/dependency directories
101101
find "$target_dir" -name "package.json" \
102-
-not -path "*/node_modules/*" \
103-
-not -path "*/.git/*" \
104-
-not -path "*/dist/*" \
105-
-not -path "*/build/*" \
106-
-print0 | while IFS= read -r -d '' package_json; do
102+
! -path "*/node_modules/*" \
103+
! -path "*/.git/*" \
104+
! -path "*/dist/*" \
105+
! -path "*/build/*" \
106+
-print | while IFS= read -r package_json; do
107107
package_dir=$(dirname "$package_json")
108108
109109
# Skip if this package already has the dependency (check both dependencies and devDependencies)

0 commit comments

Comments
 (0)