Skip to content

Commit d5bb0e9

Browse files
committed
Use GNU licenses without "-only"
1 parent a010ea8 commit d5bb0e9

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

features/scaffold-package-readme.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ Feature: Scaffold a README.md file for an existing package
538538
}
539539
"""
540540

541-
When I run `wp scaffold package-readme foo --license=GPL-2.0-only`
541+
When I run `wp scaffold package-readme foo --license=GPL-2.0`
542542
Then the foo/README.md file should exist
543543
And the foo/LICENSE file should exist
544544
And the foo/LICENSE file should contain:
@@ -547,7 +547,7 @@ Feature: Scaffold a README.md file for an existing package
547547
"""
548548
And the foo/composer.json file should contain:
549549
"""
550-
"license": "GPL-2.0-only"
550+
"license": "GPL-2.0"
551551
"""
552552

553553
Scenario: Scaffold a README.md with --license=none removes LICENSE and sets proprietary

src/ScaffoldPackageCommand.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ScaffoldPackageCommand {
4040
* : Specify a destination directory for the command. Defaults to WP-CLI's `packages/local/` directory.
4141
*
4242
* [--license=<license>]
43-
* : License for the package by SPDX code (omitting "-only" from GNU codes).
43+
* : License for the package by SPDX code. Omit "-only" for GNU licenses.
4444
* ---
4545
* default: MIT
4646
* options:
@@ -298,7 +298,7 @@ public function package( $args, $assoc_args ) {
298298
* : Name of default branch of the underlying repository. Defaults to main.
299299
*
300300
* [--license=<license>]
301-
* : License for the package by SPDX code (omitting "-only" from GNU codes).
301+
* : License for the package by SPDX code. Omit "-only" for GNU licenses.
302302
* ---
303303
* default: MIT
304304
* options:
@@ -923,12 +923,6 @@ private function resolve_license_file_path( $license, $template_path ) {
923923
if ( file_exists( $license_path ) ) {
924924
return $license_path;
925925
}
926-
927-
$without_only = (string) preg_replace( '/-only$/', '', $normalized );
928-
if ( $without_only !== $normalized && file_exists( $template_path . 'licenses/' . $without_only ) ) {
929-
return $template_path . 'licenses/' . $without_only;
930-
}
931-
932926
return null;
933927
}
934928

0 commit comments

Comments
 (0)