Skip to content

Commit

Permalink
Merge pull request #69 from wp-cli/replace-variables-in-created-files
Browse files Browse the repository at this point in the history
Replace variables in generated file path and content
  • Loading branch information
schlessera authored Jul 12, 2019
2 parents 8a004e9 + 2aadfb7 commit 1ac3dac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion features/steps/given.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function ( $world ) {
$steps->Given(
'/^an? ([^\s]+) (file|cache file):$/',
function ( $world, $path, $type, PyStringNode $content ) {
$content = (string) $content . "\n";
$path = $world->replace_variables( (string) $path );
$content = $world->replace_variables( (string) $content ) . "\n";
$full_path = 'cache file' === $type
? $world->variables['SUITE_CACHE_DIR'] . "/$path"
: $world->variables['RUN_DIR'] . "/$path";
Expand Down

0 comments on commit 1ac3dac

Please sign in to comment.