Skip to content
Snippets Groups Projects
Commit f9ebeb1a authored by Angie Byron's avatar Angie Byron
Browse files

Issue #3086081 by hussainweb, greg.1.anderson: Name of composer:scaffold command is awkward

parent 9aa7d13c
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
use Symfony\Component\Console\Output\OutputInterface;
/**
* The "composer:scaffold" command class.
* The "drupal:scaffold" command class.
*
* Manually run the scaffold operation that normally happens after
* 'composer install'.
......@@ -19,17 +19,18 @@ class ComposerScaffoldCommand extends BaseCommand {
*/
protected function configure() {
$this
->setName('composer:scaffold')
->setDescription('Update the Composer scaffold files.')
->setName('drupal:scaffold')
->setAliases(['scaffold'])
->setDescription('Update the Drupal scaffold files.')
->setHelp(
<<<EOT
The <info>composer:scaffold</info> command places the scaffold files in their
The <info>drupal:scaffold</info> command places the scaffold files in their
respective locations according to the layout stipulated in the composer.json
file.
<info>php composer.phar composer:scaffold</info>
<info>php composer.phar drupal:scaffold</info>
It is usually not necessary to call <info>composer:scaffold</info> manually,
It is usually not necessary to call <info>drupal:scaffold</info> manually,
because it is called automatically as needed, e.g. after an <info>install</info>
or <info>update</info> command. Note, though, that only packages explicitly
allowed to scaffold in the top-level composer.json will be processed by this
......
# composer-scaffold
# Drupal Composer Scaffold
This project provides a composer plugin for placing scaffold files (like
`index.php`, `update.php`, …) from the `drupal/core` project into their desired
......@@ -22,7 +22,7 @@ explicitly granted that right in the top-level composer.json file. See
## Usage
Composer-scaffold is used by requiring `drupal/core-composer-scaffold` in your
Drupal Composer Scaffold is used by requiring `drupal/core-composer-scaffold` in your
project, and providing configuration settings in the `extra` section of your
project's composer.json file. Additional configuration from the composer.json
file of your project's dependencies is also consulted in order to scaffold the
......@@ -31,6 +31,14 @@ end of scaffold files, as is commonly done to `.htaccess` and `robots.txt`
files. See [altering scaffold files](#altering-scaffold-files) for more
information.
Typically, the scaffold operations run automatically as needed, e.g. after
`composer install`, so it is usually not necessary to do anything different
to scaffold a project once the configuration is set up in the project
composer.json file, as described below. To scaffold files directly, run:
```
composer drupal:scaffold
```
### Allowed Packages
Scaffold files are stored inside of projects that are required from the main
......@@ -465,7 +473,7 @@ Patch a file after it's copied:
### drupal-composer/drupal-scaffold
Previous versions of drupal-scaffold (see community project,
Previous versions of Drupal Composer Scaffold (see community project,
[drupal-composer/drupal-scaffold](https://github.com/drupal-composer/drupal-project))
downloaded each scaffold file directly from its distribution server (e.g.
`https://git.drupalcode.org`) to the desired destination directory. This was
......
......@@ -9,6 +9,9 @@
"composer-plugin-api": "^1.0.0",
"php": ">=7.0.8"
},
"conflict": {
"drupal-composer/drupal-scaffold": "*"
},
"autoload": {
"psr-4": {
"Drupal\\Composer\\Plugin\\Scaffold\\": ""
......
......@@ -104,7 +104,7 @@ public function testComposerHooks() {
$this->mustExec("composer update --no-ansi", $sut);
$this->assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'scaffolded from the scaffold-override-fixture');
// Delete the same test scaffold file again, then run
// 'composer composer:scaffold' and see if the scaffold file is
// 'composer drupal:scaffold' and see if the scaffold file is
// re-scaffolded.
@unlink($sut . '/sites/default/default.settings.php');
$this->assertFileNotExists($sut . '/sites/default/default.settings.php');
......@@ -114,7 +114,7 @@ public function testComposerHooks() {
// 'composer install' and see if the scaffold file is re-scaffolded.
@unlink($sut . '/sites/default/default.settings.php');
$this->assertFileNotExists($sut . '/sites/default/default.settings.php');
$this->mustExec("composer composer:scaffold --no-ansi", $sut);
$this->mustExec("composer drupal:scaffold --no-ansi", $sut);
$this->assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'scaffolded from the scaffold-override-fixture');
// Run 'composer create-project' to create a new test project called
// 'create-project-test', which is a copy of 'fixtures/drupal-drupal'.
......
......@@ -191,7 +191,7 @@ public function testUnmanagedGitIgnoreWhenGitNotAvailable() {
$this->assertEquals(127, $status);
// Run the scaffold command.
$output = [];
exec('composer composer:scaffold', $output, $status);
exec('composer drupal:scaffold', $output, $status);
putenv('PATH=' . $oldPath . ':' . getenv('PATH'));
......
......@@ -112,7 +112,7 @@ public function scaffoldSut($fixture_name, $is_link = FALSE, $relocated_docroot
$sut = $this->createSut($fixture_name, ['SYMLINK' => $is_link ? 'true' : 'false']);
// Run composer install to get the dependencies we need to test.
$this->fixtures->runComposer("install --no-ansi --no-scripts", $sut);
// Test composer:scaffold.
// Test drupal:scaffold.
$scaffoldOutput = $this->fixtures->runScaffold($sut);
// Calculate the docroot directory and assert that our fixture layout
......
......@@ -13,7 +13,7 @@ Example:
$ SCAFFOLD_FIXTURE_DIR=$HOME/tmp/scaffold-fixtures composer unit
$ cd $HOME/tmp/scaffold-fixtures
$ cd drupal-drupal
$ composer composer:scaffold
$ composer drupal:scaffold
Scaffolding files for fixtures/drupal-assets-fixture:
- Link [web-root]/.csslintrc from assets/.csslintrc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment