Giter Site home page Giter Site logo

Comments (6)

theofidry avatar theofidry commented on May 25, 2024

Shouldn't that already work? If it doesn't it may be because the plugin-bar detects its being used within the command and tries to kick in before the barmani one in which case I have no idea how this could be fixed

from composer-bin-plugin.

AndreasA avatar AndreasA commented on May 25, 2024

If I use the following setup:

  • vendor-bin/composer-unused/composer.json:
{
    "require": {
        "php": "^8.1",
        "composer-runtime-api": "^2.2",
        "icanhazstring/composer-unused": "~0.7.12"
    },
    "config": {
        "sort-packages": true,
        "allow-plugins": {
            "icanhazstring/composer-unused": true
        }
    }
}
  • composer.json:
{
    "description": "Foo bar",
    "license": "MIT",
    "name": "foo/bar",
    "type": "project",
    "config": {
        "allow-plugins": {
            "bamarni/composer-bin-plugin": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "require": {
        "php": "^8.1",
        "composer-runtime-api": "^2.2",
        "bamarni/composer-bin-plugin": "^1.4"
    }
}

Then I install the composer dependencies for root and namespace:

composer install -o
composer bin composer-unused install -o

Then if I try to run the plugin:

 composer bin composer-unused unused

I get the error:

composer bin composer-unused unused


  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "unused" is not defined.

If I do

cd vendor-bin/composer-unused
composer unused

it works but it is then using the wrong composer.json to validate against.

As the plugin provides a separate command too and switches to that anyway instead of the plugin, it isn't really that problematic in this scenario but it isn't working as it should.

I also tried to add "icanhazstring/composer-unused": true to the root composer.json but that doesn't work either.

from composer-bin-plugin.

theofidry avatar theofidry commented on May 25, 2024

When you do:

 composer bin composer-unused unused

Shouldn't it work only if you install the plugin, not the package itself?

from composer-bin-plugin.

AndreasA avatar AndreasA commented on May 25, 2024

@theofidry the package is the plugin in v0.7: https://github.com/composer-unused/composer-unused/blob/0.7.12/composer.json#L3

from composer-bin-plugin.

theofidry avatar theofidry commented on May 25, 2024

I see, then I'm not sure if it's an issue within Composer (rather more a question of how it deals with plugins) or the plugin itself that does not kick in at the right time. It needs further investigation

from composer-bin-plugin.

AndreasA avatar AndreasA commented on May 25, 2024

As mentiomed I am using the binary instead of the plugin anyway (also default implemrntation with 0.8-RC) but I noticed that it wasn't working as plugin, so I thought I would report it, but if there is no easy solution to this, it is find as it is too and can just be a known limitation.

from composer-bin-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.