protected function getDrushExecutable()
    {
        if (isset($this->executable)) {
            return $this->executable;
        }

        if ($this->config->has('local.drush_executable')) {
            return $this->executable = $this->config->get('local.drush_executable');
        }

        // Find a locally installed Drush instance: first check the Composer
        // 'vendor' directory.
        $projectRoot = $this->localProject->getProjectRoot();
        $localDir = $projectRoot ?: getcwd();
        $drushLocal = $localDir . '/vendor/bin/drush';
        if (is_executable($drushLocal)) {
            return $this->executable = $drushLocal;
        }

        // Check the local dependencies directory (created via 'platform
        // build').
        $drushDep = $localDir . '/' . $this->config->get('local.dependencies_dir') . '/php/vendor/bin/drush';
        if (is_executable($drushDep)) {
            return $this->executable = $drushDep;
        }

        // Use the global Drush, if there is one installed.
        if ($this->shellHelper->commandExists('drush')) {
            return $this->executable = $this->shellHelper->resolveCommand('drush');
        }

        // Fall back to the Drush that may be installed within the CLI.
        $drushCli = CLI_ROOT . '/vendor/bin/drush';
        if (is_executable($drushCli)) {
            return $this->executable = $drushCli;
        }

        return $this->executable = 'drush';
    }