rtablada / package-installer

Easy installation of Laravel 4 packages
129 stars 16 forks source link

Add a way to execute post-install tasks #7

Open Anahkiasen opened 11 years ago

Anahkiasen commented 11 years ago

I think there should be a way to specify in the provides.json a list of commands to call post-install like with Composer. Some packages require the user to do artisan config:publish vendor/package or artisan asset:publish vendor/package, it would be great if those could be automated in the install process.

rtablada commented 11 years ago

I definitely like this idea. I'll look at the best way to execute this, but i think it shouldn't be too difficult.

Should it automatically default to artisan only commands?  — Sent from Mailbox for iPhone

On Mon, Jun 24, 2013 at 7:19 AM, Maxime Fabre notifications@github.com wrote:

I think there should be a way to specify in the provides.json a list of commands to call post-install like with Composer.

Some packages require the user to do artisan config:publish vendor/package or artisan asset:publish vendor/package, it would be great if those could be automated in the install process.

Reply to this email directly or view it on GitHub: https://github.com/rtablada/package-installer/issues/7

Anahkiasen commented 11 years ago

Hm well I guess it depends, I can't think of non-artisan tasks to execute but you never know.

caouecs commented 11 years ago

Hi, and if you add an option "post-install" with the list of tasks

{
  "providers": [
    "Illuminate\Html\HtmlServiceProvider"
  ],
  "aliases": [
    {
      "alias": "HTML",
      "facade": "Illuminate\Support\Facades\HTML"
    }
  ],
  "post-install": [
     "config", "asset"
  ]
}
Anahkiasen commented 11 years ago

Hm no, I think there should be as little magic as possible in here; the more automation you'll put in, the less flexible that array will be.

tlgreg commented 10 years ago

This would be a good feature.

But I agree, it would better to just simply list the commands it should run post-install.

{
  "providers": [
    "Illuminate\Html\HtmlServiceProvider"
  ],
  "aliases": [
    {
      "alias": "HTML",
      "facade": "Illuminate\Support\Facades\HTML"
    }
  ],
  "post-install": [
     "php artisan config:publish vendor/package",
     "php artisan asset:publish vendor/package",
     "php artisan migrate --package=vendor/package"
  ]
}

Maybe leave out the php artisan part, but I think thats still ok.

caouecs commented 10 years ago

Hello, yes and no, because sometimes you need to add --env= for example for migrate

Anahkiasen commented 10 years ago

Well so what, you can put the env at the end ?

caouecs commented 10 years ago

you can't change yourself provides.json of a package, so you need to add it when you launch installation of this package, and your purpose of "post-install" doesnt include options