composer / installers

A Multi-Framework Composer Library Installer
MIT License
1.43k stars 414 forks source link

wordpress-plugin and wordpress-theme types throw errors with path repositories #267

Closed joshdaws closed 8 years ago

joshdaws commented 8 years ago

I'm trying to use a repository of type path with a local package of type wordpress-plugin. I get the following error:

[InvalidArgumentException] $from (web/app/themes/acf-pro/) and $to (/Users/dawsj028/www/tm-plugins/adv anced-custom-fields-pro) must be absolute paths.

If I remove the type attribute from composer.json it installs to the vendor directory as expected. Any ideas?

johnnytrinh commented 8 years ago

Can you paste the entire composer.json file? is there a copy mistake for the ACF plugin since there is a space in 'advanced'?

joshdaws commented 8 years ago

That was a paste error. Here's the project composer.json:

{
  "name": "roots/bedrock",
  "type": "project",
  "config": {
    "preferred-install": "dist"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "http://wpackagist.org"
    },
    {
        "type": "path",
        "url": "../../tm-plugins/*"
    }

  ],
  "require": {
    "php": ">=5.5",
    "composer/installers": "~1.0.21",
    "vlucas/phpdotenv": "^2.0.1",
    "johnpbloch/wordpress": "4.3.1",
    "wpackagist-plugin/advanced-custom-fields": "dev-trunk",
    "tm-plugins/acf-pro": "*@dev"
  },
  "extra": {
    "installer-paths": {
      "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
      "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
      "web/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "web/wp"
  }
}

And here's the package json:

{
  "name": "tm-plugins/acf-pro",
  "description": "Advanced Custom Fields Pro",
  "type": "wordpress-plugin",
  "require": {
    "php": ">=5.5",
    "composer/installers": "~1.0.21"
  }
}
joshdaws commented 8 years ago

I tried a few other package types. It seems to be a universal issue with installers and path repositories.

joshdaws commented 8 years ago

I've created a pull request to fix this issue. https://github.com/composer/installers/pull/272

dzuelke commented 8 years ago

The fix in #272 is wrong. The issue is the trailing slashes in your installer paths. If you remove them, the symlink succeeds.

Seldaek commented 8 years ago

Closed by https://github.com/composer/composer/pull/5164