Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Project detection: drop site folder requirement #326

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

swalkinshaw
Copy link
Member

This makes the project detector more flexible and less strict by dropping the site folder requirement. Previously the detector would only recognize the recommended folder structure when not directly inside a trellis folder. Your project would have to be structured like this:

example.com/       # → Root folder for the project
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory
└── site/          # → A Bedrock-based WordPress site
    └── web/

site was required to limit false positives but isn't necessary due to the other requirement for the .trellis config directory.

By dropping the site requirement, this means trellis-cli will work better in two other known folder structures:

  • where the "site" folder exists but it named differently some_project_name/ # → Root folder for the project
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory
└── example.com/   # → A Bedrock-based WordPress site
    └── web/
  • where the root is the site contents, and trellis is a subdirectory
example.com/       # → A Bedrock-based WordPress site
└── web/
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory

@swalkinshaw swalkinshaw requested a review from retlehs October 4, 2022 23:49
This makes the project detector more flexible and less strict by
dropping the `site` folder requirement. Previously the detector would
only recognize the recommended folder structure when not directly inside a
`trellis` folder. Your project would have to be structured like this:

example.com/       # → Root folder for the project
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory
└── site/          # → A Bedrock-based WordPress site
    └── web/

`site` was required to limit false positives but isn't necessary due to
the other requirement for the `.trellis` config directory.

By dropping the `site requirement`, this means trellis-cli will work
better in two other known folder structures:

* where the "site" folder exists but it named differently
some_project_name/ # → Root folder for the project
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory
└── example.com/   # → A Bedrock-based WordPress site
    └── web/

* where the root _is_ the site contents, and trellis is a subdirectory
example.com/       # → A Bedrock-based WordPress site
└── web/
├── trellis/       # → Your server configuration (a customized install of Trellis)
    └── .trellis/  # → trellis-cli config directory
@swalkinshaw swalkinshaw force-pushed the more-flexible-project-detection branch from fedb04a to 281bc78 Compare October 6, 2022 02:40
@swalkinshaw swalkinshaw merged commit 561fdee into master Oct 6, 2022
@swalkinshaw swalkinshaw deleted the more-flexible-project-detection branch October 6, 2022 02:52
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant