Skip to content

Commit 850a7dd

Browse files
committed
Updated code analysis script
1 parent b4a991a commit 850a7dd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ Running statis code analysis on a standalone Drupal module is a bit tricky, so w
4444
analysis:
4545

4646
```sh
47-
./scripts/code-analysis
47+
docker run --rm --volume ${PWD}:/app --workdir /app itkdev/php8.3-fpm ./scripts/code-analysis
4848
```

scripts/code-analysis

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,20 @@ if [ ! -f "$drupal_dir/composer.json" ]; then
1616
composer --no-interaction create-project drupal/recommended-project:^10 "$drupal_dir"
1717
fi
1818
# Copy our code into the modules folder
19-
mkdir -p "$drupal_dir/$module_path"
19+
20+
# Clean up
21+
rm -fr "$drupal_dir/$module_path"
22+
2023
# https://stackoverflow.com/a/15373763
21-
rsync --archive --compress . --filter=':- .gitignore' --exclude "$drupal_dir" --exclude .git "$drupal_dir/$module_path"
24+
# rsync --archive --compress . --filter=':- .gitignore' --exclude "$drupal_dir" --exclude .git "$drupal_dir/$module_path"
25+
26+
# The rsync command in not available in itkdev/php8.3-fpm
27+
28+
git config --global --add safe.directory /app
29+
# Create directories
30+
git ls-files -z | xargs --null -I {} --verbose bash -c 'mkdir -p '"$drupal_dir/$module_path/"'$(dirname {})'
31+
# Copy files
32+
git ls-files -z | xargs --null -I {} cp {} "$drupal_dir/$module_path/{}"
2233

2334
drupal_composer config minimum-stability dev
2435

0 commit comments

Comments
 (0)