Open DuaelFr opened 6 years ago
@DuaelFr Could you post your composer.json as well?
Sure! Prepare to be stunned ;)
$ cat composer.json
{
"require": {
"drush/drush": "~8.0"
}
}
(I told you it is not a project built with composer ^^)
drupal-finder
relies on the configuration for composer installers. You could try to make it work. If you configure these path accordingly to your structure. Even if you don't install drupal core via composer.
It works, thanks! It would be great if it was documented, maybe in your readme? :)
How did you make it work? Sorry for n00b question, which path did you put where @DuaelFr ?
I got the same issue on my D7 non-composer install :D
Here is my composer.json file. My drupal root is located in the www
directory.
{
"require": {
"drush/drush": "~8.0"
},
"extra": {
"installer-paths": {
"www": ["type:drupal-core"],
"www/sites/all/libraries/{$name}": ["type:drupal-library"],
"www/sites/all/modules/contrib/{$name}": ["type:drupal-module"],
"www/profiles/contrib/{$name}": ["type:drupal-profile"],
"www/sites/all/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
}
}
}
I suppose the only important line is the type:drupal-core
one but I don't really know.
Ok there you are. This is my working composer.json for D7 installations.
{
"require": {
"drush/drush": "~8.0",
"webflo/drupal-finder": "^1.0.0"
},
"extra": {
"installer-paths": {
".": [
"type:drupal-core"
]
}
}
}
Sorry to bother, but could you please point me to where I could learn how to use this composer.json to enable drush for my non-composer created vagrant D7 site? Where do I put his file, and what do I then to to run it and enable drush?
@wdseelig – Seems off-topic to me, as this is the drupal-finder repo, not drush-launcher. But for what it's worth: It's absolutely not recommended (not supported) to use a local Drush in a non-Composer managed site. See https://github.com/drush-ops/drush-launcher/issues/33 (read until the end).
You are putting your site at risk doing it that way. Since running drush up
for example can potentially delete your whole web directory (tracked or untracked files all gone).
Instead consider to Composerize your project using https://github.com/grasmash/composerize-drupal first.
@wdseelig what's saying @leymannx have a lot of sense. I did this for a custom need so please keep this in mind.
In my example I just added a composer.json
with the mentioned code inside at the D7 root dir and runned composer install
.
Hiya, I also had this issue, but I am being told to not use drush launcher by a colleague, so how do I get rid of drush launcher? sorry if this is a stupid question!
While in a D7 root directory, I can't use drush launcher because it does not recognize a Drupal installation.
My D7 is not installed via composer (5 years old project). It is in a www folder, at the same level of the composer.json that's used to require drush 8.