diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml deleted file mode 100644 index 0961a37..0000000 --- a/bitbucket-pipelines.yml +++ /dev/null @@ -1,29 +0,0 @@ -image: composer/composer:latest -pipelines: - default: - - step: - script: - # Show software versions. - - composer self-update - - composer --version - - php -v - - # Install SSH keys. - - mkdir -p /root/.ssh - - chmod 700 /root/.ssh - - - echo "$PIPELINES_PRIVATE_KEY" | sed 's/\\n/\n/g' | cat > /root/.ssh/id_rsa - - chmod 600 /root/.ssh/id_rsa - - - echo "$BITBUCKET_KNOWN_HOSTS" >> /root/.ssh/known_hosts - - # Composer installation. - - echo "$COMPOSER_AUTHENTICATION" > $COMPOSER_HOME/auth.json - - composer validate --strict --no-interaction - - export BIN=$(composer config bin-dir) - - - composer install --dev --prefer-dist --no-scripts --ignore-platform-reqs --no-progress --optimize-autoloader --no-interaction - - # Require the coding standards, if they are not explicitly defined. - # Execute tests from MediaCT testing bundle - - $BIN/mediact-testing-suite \ No newline at end of file diff --git a/src/UnixFileMapping.php b/src/UnixFileMapping.php index cc5870d..d3ef7f6 100644 --- a/src/UnixFileMapping.php +++ b/src/UnixFileMapping.php @@ -36,7 +36,7 @@ public function __construct( $this->destinationDirectory = $destinationDirectory; // Expand the source and destination. - static $pattern = '/({(.*),(.*)})/'; + static $pattern = '/({(.*?),(.*?)})/'; $this->source = preg_replace($pattern, '$2', $mapping); $this->destination = preg_replace($pattern, '$3', $mapping); } diff --git a/tests/UnixFileMappingTest.php b/tests/UnixFileMappingTest.php index 7f99ca4..aeb34db 100644 --- a/tests/UnixFileMappingTest.php +++ b/tests/UnixFileMappingTest.php @@ -30,6 +30,11 @@ public function mappingProvider(): array 'bitbucket-pipelines.yml{.dist,}', 'bitbucket-pipelines.yml.dist', 'bitbucket-pipelines.yml' + ], + [ + '{default/,}bitbucket-pipelines.yml{.dist,}', + 'default/bitbucket-pipelines.yml.dist', + 'bitbucket-pipelines.yml' ] ]; }