Skip to content

Commit acca457

Browse files
Move circle.yml to .circleci/config.yml (#210)
1 parent c472d13 commit acca457

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
File renamed without changes.

features/scaffold-package-tests.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ Feature: Scaffold the test suite for an existing package
8080
"""
8181
- composer behat
8282
"""
83-
And the community-command/circle.yml file should not exist
83+
And the community-command/.circleci/config.yml file should not exist
8484

85-
Scenario: Scaffolds .travis.yml configuration file with argument
85+
Scenario: Scaffolds CircleCI configuration file with argument
8686
When I run `wp scaffold package-tests community-command --ci=circle`
8787
Then STDOUT should not be empty
88-
And the community-command/circle.yml file should exist
89-
And the community-command/circle.yml file should contain:
88+
And the community-command/.circleci/config.yml file should exist
89+
And the community-command/.circleci/config.yml file should contain:
9090
"""
9191
composer prepare-tests
9292
"""
93-
And the community-command/circle.yml file should contain:
93+
And the community-command/.circleci/config.yml file should contain:
9494
"""
9595
composer test
9696
"""

src/ScaffoldPackageCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function package_readme( $args, $assoc_args ) {
262262
if ( file_exists( $package_dir . '/.travis.yml' ) ) {
263263
$shields[] = "[![Build Status](https://travis-ci.org/{$readme_args['package_name']}.svg?branch={$branch})](https://travis-ci.org/{$readme_args['package_name']})";
264264
}
265-
if ( file_exists( $package_dir . '/circle.yml' ) ) {
265+
if ( file_exists( $package_dir . '/.circleci/config.yml' ) ) {
266266
$shields[] = "[![CircleCI](https://circleci.com/gh/{$readme_args['package_name']}/tree/{$branch}.svg?style=svg)](https://circleci.com/gh/{$readme_args['package_name']}/tree/{$branch})";
267267
}
268268

@@ -678,7 +678,7 @@ public function package_tests( $args, $assoc_args ) {
678678
$travis_append = file_get_contents( $package_dir . 'travis-append.yml' );
679679
}
680680
} elseif ( 'circle' === $assoc_args['ci'] ) {
681-
$copy_source[ $package_root ]['circle.yml'] = $package_dir;
681+
$copy_source[ $package_root ]['.circleci/config.yml'] = $package_dir . '.circleci/';
682682
}
683683

684684
$files_written = [];
@@ -712,6 +712,10 @@ public function package_tests( $args, $assoc_args ) {
712712
}
713713
$files_written[] = $file_path;
714714

715+
if ( ! is_dir( dirname( $file_path ) ) ) {
716+
Process::create( Utils\esc_cmd( 'mkdir %s', dirname( $file_path ) ) )->run();
717+
}
718+
715719
Process::create( Utils\esc_cmd( 'touch %s', $file_path ) )->run();
716720
file_put_contents( $file_path, $contents );
717721
}

0 commit comments

Comments
 (0)