Skip to content

Commit

Permalink
Fix CLI history path and startBrowser(). (#5001)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Jan 9, 2022
1 parent 4a514c9 commit a355f9e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
5 changes: 0 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ init:
# Inspired by https://github.com/Codeception/base/blob/master/appveyor.yml and https://github.com/phpmd/phpmd/blob/master/appveyor.yml
install:
- ps: Set-Service wuauserv -StartupType Manual
# - ps: appveyor-retry cinst -y curl
# - SET PATH=C:\Program Files\curl;%PATH%
#which is only needed by the test suite.
- cinst --limit-output -y which
- SET PATH=C:\Program Files\which;%PATH%
- git clone -q https://github.com/acquia/DevDesktopCommon.git #For tar, cksum, ...
- SET PATH=%APPVEYOR_BUILD_FOLDER%/DevDesktopCommon/bintools-win/msys/bin;%PATH%
- SET PATH=C:\Program Files\MySql\MySQL Server 5.7\bin\;%PATH%
Expand Down
4 changes: 2 additions & 2 deletions src/Drupal/Commands/core/CliCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use Drupal\Component\Assertion\Handle;
use Drush\Psysh\Shell;
use Drush\Runtime\Runtime;
use Drush\Utils\FsUtils;
use Psy\Configuration;
use Psy\VersionUpdater\Checker;
use Webmozart\PathUtil\Path;

class CliCommands extends DrushCommands
{
Expand Down Expand Up @@ -174,7 +174,7 @@ protected function getCasters(): array
*/
protected function historyPath(array $options): string
{
$cli_directory = Path::join($this->getConfig()->cache(), 'cli');
$cli_directory = FsUtils::getBackupDirParent();
$drupal_major_version = Drush::getMajorVersion();

// If there is no drupal version (and thus no root). Just use the current
Expand Down
2 changes: 1 addition & 1 deletion src/Exec/ExecTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function startBrowser($uri = null, int $sleep = 0, ?int $port = null, $br
if ($browser) {
// We can only open a browser if we have a DISPLAY environment variable on
// POSIX or are running Windows or OS X.
if (!Drush::simulate() && !getenv('DISPLAY') && !drush_is_windows() && !drush_is_osx()) {
if (!Drush::simulate() && !getenv('DISPLAY') && !in_array(PHP_OS_FAMILY, ['Windows', 'Darwin'])) {
$this->logger()->info(dt('No graphical display appears to be available, not starting browser.'));
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/FsUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public static function getBackupDir($subdir = null): string
}

/**
* Get the base dir where our backup directories will be stored
* Get the base dir where our backup directories will be stored. Also stores CLI history file.
*
* @return
* A path to the backup directory parent
* @throws \Exception
*/
protected static function getBackupDirParent()
public static function getBackupDirParent()
{
// Try in order:
// 1. The user-specified backup directory from drush.yml config file
Expand Down

0 comments on commit a355f9e

Please sign in to comment.