trizen / clyrics

An extensible lyrics fetcher, with daemon support for cmus and mocp.
https://trizenx.blogspot.com/2013/02/mocp-lyrics.html
GNU General Public License v3.0
56 stars 15 forks source link

fix launch via a symlink #23

Closed Veraellyunjie closed 8 months ago

Veraellyunjie commented 8 months ago
> ln -s /path/to/clyrics /clyrics/symlink
> /clyrics/symlink
** Couldn't find any plugins...

$FindBin::RealBin solves it.

Also, rephrased a bit for shortness, from:

    if (-d (my $dir = catdir($FindBin::RealBin, 'plugins'))) {
        push @plugins_dirs, $dir;
    }

to:

    -d && push @plugins_dirs, $_ for catdir $FindBin::RealBin, 'plugins';     

Shorter yet might be too dense for your liking... Can revert it if you prefer step-by-step better :)