Skip to content

Fail gracefully when $this->appDir./sites not found #19

Open
@JParkinson1991

Description

@JParkinson1991

During installation of this package, during early site builds where the 'sites' directory does not exist under $this->appDir/sites an InvalidArgumentException or a DirectoryNotFoundException will be thrown by the Symfony Finder package.

This can cause failed installations and also causes the drupal:paranoia command to fail.

These exceptions should be caught by the Installer and handled gracefully.

It is safe to assumes public files directories do not exist under $this->appDir if the sites directory is not found.

Expected behavior

Failing gracefully without attempting to link the non existent directories.

Actual behavior

Uncaught exception breaking package installation, plugin events and the provided commands.

Steps to reproduce

During install

  1. Create a project without a 'sites' directory inside the configured app-dir
  2. Require drupal-composer/drupal-paranoia
  3. See the uncaught exception in console output

When running as a command

  1. Create a project without a 'sites' directory inside the configured app-dir
  2. Require drupal-composer/drupal-paranoia
  3. Run composer drupal:paranoia
  4. See the uncaught exception in console output

Possible solution

#20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions