Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you install unstable packages just with command-line?

To install the latest development version of a given package and get over the conflict with your requirements or minimum-stability error I understand I have to create a composer.json file and set minimum-stability to dev.

Is it possible to grant the appropriate permissions right from the command-line with a reasonably simple command or command set?


Apparently, the only command that has a --stability argument is composer init but it forces you to get through and endless interrogation that only gets on the way when you're about to write code not for Packagist:

C:\tmp\foo>composer init --stability dev


  Welcome to the Composer config generator



This command will guide you through creating your composer.json config.

Package name (<vendor>/<name>) [alvaro.gonzalez/foo]:
Description []:
Author [, n to skip]: n
Minimum Stability [dev]:
Package Type (e.g. library, project, metapackage, composer-plugin) []:
License []:

Define your dependencies.

Would you like to define your dependencies (require) interactively [yes]? no
Would you like to define your dev dependencies (require-dev) interactively [yes]? no

{
    "name": "alvaro.gonzalez/foo",
    "minimum-stability": "dev",
    "require": {}
}

Do you confirm generation [yes]?

C:\tmp\foo>
like image 626
Álvaro González Avatar asked Jul 28 '16 07:07

Álvaro González


1 Answers

You can use composer config minimum-stability dev

The full oneliner would be composer init --name=alvaro.gonzalez/foo --no-interaction; composer config minimum-stability dev

like image 176
Giso Stallenberg Avatar answered Nov 10 '22 17:11

Giso Stallenberg