Skip to content

Commit

Permalink
Fix: Optimise deprecation stage (#50)
Browse files Browse the repository at this point in the history
* add file exists check for phpstan.neon file and move output into general if statement

* fix: add missing slash in file exists check
  • Loading branch information
IT-Cru authored Aug 10, 2021
1 parent c6b3cf6 commit c315b23
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/stages/deprecation.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/usr/bin/env bash

_stage_deprecation() {
printf "Checking for deprecations.\n\n"
if ${DRUPAL_TESTING_TEST_DEPRECATION}; then
printf "Checking for deprecations.\n\n"

local project_location
local composer_bin_dir
local project_location
local composer_bin_dir

project_location=$(get_project_location)
composer_bin_dir=$(get_composer_bin_directory)
project_location=$(get_project_location)
composer_bin_dir=$(get_composer_bin_directory)

if [ ! -f "${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}/phpstan.neon" ]; then
cp phpstan.neon "${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
fi

if ${DRUPAL_TESTING_TEST_DEPRECATION}; then
cp phpstan.neon "${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}"
cd "${DRUPAL_TESTING_DRUPAL_INSTALLATION_DIRECTORY}" || exit
"${composer_bin_dir}/phpstan" analyse --memory-limit "${PHPSTAN_MEMORY_LIMIT}" "${project_location}"
cd - || exit
Expand Down

0 comments on commit c315b23

Please sign in to comment.