Skip to content

Commit df8564e

Browse files
committed
feat(license): add command and documentation for LICENSE file generation
Signed-off-by: Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
1 parent fad9aff commit df8564e

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ composer dev-tools skills
7777
# Merges and synchronizes .gitignore files
7878
composer dev-tools gitignore
7979

80+
# Generates a LICENSE file from composer.json license information
81+
composer dev-tools license
82+
8083
# Installs and synchronizes dev-tools scripts, GitHub Actions workflows,
8184
# .editorconfig, .gitignore rules, packaged skills, and the repository wiki
8285
# submodule in .github/wiki

docs/api/commands.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ resolution, configuration fallback, PSR-4 lookup, and child-command dispatch.
4949
- ``dev-tools:sync``
5050
- Synchronizes consumer-facing scripts, automation assets, and packaged
5151
skills.
52-
* - ``FastForward\DevTools\Command\GitIgnoreCommand``
53-
- ``gitignore``
54-
- Merges and synchronizes .gitignore files.
52+
* - ``FastForward\DevTools\Command\GitIgnoreCommand``
53+
- ``gitignore``
54+
- Merges and synchronizes .gitignore files.
55+
* - ``FastForward\DevTools\Command\CopyLicenseCommand``
56+
- ``license``
57+
- Generates a LICENSE file from composer.json license information.

docs/running/specialized-commands.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,22 @@ Important details:
199199
- duplicates are removed and entries are sorted alphabetically;
200200
- it uses the Reader, Merger, and Writer components from the GitIgnore
201201
namespace.
202+
203+
``license``
204+
----------
205+
206+
Generates a LICENSE file from composer.json license information.
207+
208+
.. code-block:: bash
209+
210+
composer dev-tools license
211+
212+
Important details:
213+
214+
- it reads the ``license`` field from ``composer.json``;
215+
- it supports common open-source licenses (MIT, Apache-2.0, BSD-2-Clause,
216+
BSD-3-Clause, GPL-3.0, LGPL-3.0, and MPL-2.0);
217+
- it resolves placeholders such as ``[year]``, ``[author]``, and
218+
``[project]`` using information from ``composer.json``;
219+
- it uses template files from ``resources/license-templates/``;
220+
- it skips generation if a LICENSE file already exists.

0 commit comments

Comments
 (0)