Closed thinkspill closed 7 years ago
When using composer
directly, this is a two-step process:
composer global config minimum-stability dev
composer global require trismegiste/mondrian
Unfortunately, Composer does not have any standard options on the require
command to edit the minimum-stability configuration value, as it does for some of its other commands. Therefore, I'll have to add some sort of non-standard option to the cgr command to make it configure the minimum stability prior to running composer require
in the appropriate directory.
Minimum stability is a common enough use-case that it seems worth supporting. It would be a little complicated to support general-purpose composer.json editing in cgr, I think, but let me know if you have any ideas on how this might work simply.
This is now available via --stability dev
It would be cool to have this documented in the error messge or the help. Especially as this deviates from the guessed composer --minimum-stability.
(here's what i did before the web search...)
merlin@thinker:~$ cgr joachim-n/dorgflow
>> Running: composer '--working-dir=/home/merlin/.config/composer/global/joachim-n/dorgflow' 'require' 'joachim-n/dorgflow'
[InvalidArgumentException]
Could not find package joachim-n/dorgflow at any version for your minimum-stability (stable). Check the package s
pelling or your minimum-stability
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...
merlin@thinker:~$ cgr --help
The 'cgr' tool is a "safer" alternative to 'composer global require'.
Installing projects with cgr helps avoid dependency conflicts between
different tools. Use 'cgr' wherever 'composer global require' is recommended.
Examples:
Install a project:
------------------
$ cgr drush/drush
Display the info of a project:
-----------------------------
$ cgr info drush/drush
Display the info of all projects installed via 'cgr':
----------------------------------------------------
$ cgr info
Update a project:
-----------------
$ cgr update drush/drush
Update all projects installed via 'cgr':
----------------------------------------
$ cgr update
Remove a project:
-----------------
$ cgr remove drush/drush
For more information, see: https://github.com/consolidation/cgr
merlin@thinker:~$ cgr joachim-n/dorgflow --minimum-stability=dev
>> Running: composer '--minimum-stability=dev' '--working-dir=/home/merlin/.config/composer/global/joachim-n/dorgflow' 'require' 'joachim-n/dorgflow'
[Symfony\Component\Console\Exception\RuntimeException]
The "--minimum-stability" option does not exist.
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...
When I read about your project I immediately thought of using it to get this other project installed:
https://github.com/Trismegiste/Mondrian
However, I'm stuck on this:
Is there a way to override a
minimum-stability
requirement here? And if not, is there a way to set up arepositories
key so I can try installing a fork with fixed requirements?Thanks for the awesome tool!