I installed the Font Awesome module with composer and enabled the module:

composer require drupal/fontawesome
drush en fontawesome -y
drush cr

When I try using the drush command to download the library I get an error:

drush fa-download
The drush command 'fa-download' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.

After running cache-clear I still get the error message. I'm using drush version 8.1.16 on Drupal 8.6.3.

When I manually download the fa library everythng works as expected.

CommentFileSizeAuthor
#4 fontawesome-2745741-4.patch467 bytestruls1502

Comments

paper boy created an issue. See original summary.

daniel.moberly’s picture

Status: Active » Postponed (maintainer needs more info)

Are you calling the command from the web root? Running this command on a fresh install for me properly downloads the library.

lowfidelity’s picture

Yes, I'm running drush from web root in the above example. I can use all other drush commands from this directory without any problems. It just looks like drush does not recognize the fa-download command. Cache was rebuilt.

I also tried the same on a fresh install, but here with another Drush and Drupal (8.6.x-dev) version:

drush --version
Drush Launcher Version: 0.6.0
Drush Commandline Tool 9.5.2

With this combination I get another problem. After installing the module with composer I can successfully execute drush fa-download (or fa:download). The library is downloaded but I get the error "failed to open dir: No such file or directory. Here's what I'm doing:

composer require drupal/fontawesome
Using version ^2.9 for drupal/fontawesome
./composer.json has been updated
No patches supplied.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
No patches supplied.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/fontawesome (2.9.0): Downloading (100%)         
Writing lock file
Generating optimized autoload files
drush en fontawesome -y
[success] Successfully enabled: fontawesome

At this point no libraries directory exists in my web root.

drush fa-download
In Filesystem.php line 562:                                                                                                                                                     RecursiveDirectoryIterator::__construct(/var/www/drupal/public_html/libraries/fontawesome/fontawesome-free-5.5.0-web): failed to open dir: No such file or directory

After this the directory ./libraries/fontawesome exists, but it also contains another directory fontawesome-free-5.3.1-web. This directory contains all files of the fontawesome library.

Note, that the error message states fontawesome-free-5.5.0-web and the directory that was created is fontawesome-free-5.3.1-web.

fontawesome.libraries.yml refers to version 5.3.1:

fontawesome.svg:
  remote: https://use.fontawesome.com/releases/v5.3.1/fontawesome-free-5.3.1-web.zip
  license: &fontawesome_svg_license
    name: CC BY 4.0
    url: https://fontawesome.com/license
    gpl-compatible: true
  version: &fontawesome_version "5.5.0"
  js:
    /libraries/fontawesome/js/all.js: { minified: true }
truls1502’s picture

StatusFileSize
new467 bytes

Added patch and does it works with the patch?

daniel.moberly’s picture

Status: Postponed (maintainer needs more info) » Needs review

Good catch. I think the patch should fix the problem and it should be applied whether it resolves or not.

lowfidelity’s picture

Yes, fixes the problem I had on the fresh install mentioned in #3.

Haven't tried on the site mentioned in #1 but I'm pretty sure, this patch won't fix the initial issue. Also a reinstall of the module doesn't fix the problem on the other site, which is also "pretty fresh", just a few contrib modules installed so far.

truls1502’s picture

Sure it should be applied whether this current issue is resolved or not.

However, before to commit, I would like to know if the patch is solving the @paper-boy regarding this current issue? Do you, @paper-boy, mind to test with the patch from #4 and let us know if it solve your Drush command? :)

lowfidelity’s picture

Applied the patch on the site from #1. Does not fix the problem.

drush fa-download
The drush command 'fa-download' could not be found.  Run `drush cache-clear drush` to clear the commandfile cache if you have installed new[error]
extensions.

But as mentioned above, the patch from #4 fixes the problem described in #3 on a fresh install with newer drush version.

Might this be a compatibility issue with older drush version?

daniel.moberly’s picture

Status: Needs review » Fixed

Ah, yes. Currently Fontawesome only supports Drush 9.

Let's open a child issue for adding Drush 8 support and get this one committed.

daniel.moberly’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.