Skip to content

Commit

Permalink
Switch to use the local Drush if it was installed in the project. Onl…
Browse files Browse the repository at this point in the history
…y use the global Drush in the system, when no local one in the project #55
  • Loading branch information
Natshah committed Dec 18, 2022
1 parent a5a55bf commit 5c4ffd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
13 changes: 0 additions & 13 deletions scripts/update/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ function get_file($url, $newfilename) {
mkdir(getcwd().'/scripts/update', 0777, true);
}

if (!file_exists(getcwd().'/drush')) {
mkdir(getcwd().'/drush', 0777, true);
}

if (!file_exists(getcwd().'/bin')) {
mkdir(getcwd().'/bin', 0777, true);
}
Expand All @@ -134,15 +130,6 @@ function get_file($url, $newfilename) {
get_file($base_path . "scripts/update/version-check.php", getcwd().'/scripts/update/version-check.php');
get_file($base_path . "scripts/update/update-config.json", getcwd().'/scripts/update/update-config.json');

// Only download them if they don't exist.
if (!file_exists(getcwd().'/drush/policy.drush.inc')) {
get_file($base_path . "drush/policy.drush.inc", getcwd().'/drush/policy.drush.inc');
}

if (!file_exists(getcwd().'/drush/README.md')) {
get_file($base_path . "drush/README.md", getcwd().'/drush/README.md');
}

chmod(getcwd().'/scripts/update/update-varbase.sh', 0755);
chmod(getcwd().'/scripts/update/version-check.php', 0755);
chmod(getcwd().'/scripts/composer/VarbaseUpdate.php', 0755);
Expand Down
7 changes: 7 additions & 0 deletions scripts/update/varbase-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ DRUPALPATH='docroot';
if [ -d "${BASEDIR}/web" ]; then
DRUPALPATH='web';
fi

# Use the local Drush if it was insalled in the project.
# If not in the local, use the global Drush in the system.
DRUSH="drush";
if [ -d "${BASEDIR}/vendor/drush/drush" ]; then
DRUSH="${BASEDIR}/vendor/drush/drush/drush";
fi

clear;
echo "$(tput setaf 4)";
cat << "EOF"
Expand Down

0 comments on commit 5c4ffd2

Please sign in to comment.