Skip to content

Instantly share code, notes, and snippets.

@tedbow
Last active May 26, 2020 12:39
Show Gist options
  • Save tedbow/1c478f10283621cbe091090d07f3aa00 to your computer and use it in GitHub Desktop.
Save tedbow/1c478f10283621cbe091090d07f3aa00 to your computer and use it in GitHub Desktop.
set drush temp
diff --git a/stats/project_analysis/analyzer.sh b/stats/project_analysis/analyzer.sh
index c1f24a0..e852675 100755
--- a/stats/project_analysis/analyzer.sh
+++ b/stats/project_analysis/analyzer.sh
@@ -17,8 +17,8 @@ COMPOSER_CACHE_DIR=/tmp/cache$5 composer --no-interaction --no-progress require
# Ensure the directory was created where we thought it should be.
if [[ -d "/var/lib/drupalci/workspace/drupal-checkouts/drupal$5/${4#project_}s/contrib/$2" ]]; then
- sudo $composer_home/vendor/bin/drush en $2 -y
- sudo $composer_home/vendor/bin/drush upgrade_status:checkstyle $2 > /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.pre_rector.xml 2>> /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status_stderr
+ sudo php -d sys_temp_dir=/var/lib/drupalci/workspace/drupal-checkouts/drupal$5 $composer_home/vendor/bin/drush en $2 -y
+ sudo php -d sys_temp_dir=/var/lib/drupalci/workspace/drupal-checkouts/drupal$5 $composer_home/vendor/bin/drush upgrade_status:checkstyle $2 > /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.pre_rector.xml 2>> /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status_stderr
# Only run rector if we have some file messages in the XML.
php -d sys_temp_dir=/var/lib/drupalci/workspace/drupal-checkouts/drupal$5 ./vendor/bin/rector_needed /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.pre_rector.xml
@@ -55,7 +55,7 @@ if [[ -d "/var/lib/drupalci/workspace/drupal-checkouts/drupal$5/${4#project_}s/c
# Uncommitted changes
create_patch=1
# Check to see we can update the info file now.
- sudo $composer_home/vendor/bin/drush upgrade_status:checkstyle $2 > /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.post_rector.xml 2>> /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status_stderr
+ sudo php -d sys_temp_dir=/var/lib/drupalci/workspace/drupal-checkouts/drupal$5 $composer_home/vendor/bin/drush upgrade_status:checkstyle $2 > /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.post_rector.xml 2>> /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status_stderr
php -d sys_temp_dir=/var/lib/drupalci/workspace/drupal-checkouts/drupal$5 ./vendor/bin/info_updatable /var/lib/drupalci/workspace/phpstan-results/$1.$3.upgrade_status.post_rector.xml
info_updatable_result=$?
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment