Skip to content

Commit

Permalink
Specifying scoper output dir in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Jan 3, 2023
1 parent 20f3f59 commit 3430186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gulp.task('build:css', gulp.parallel('build:css:admin', 'build:css:frontend'));
gulp.task(
'build:deps:composer:scoper',
shell.task(
'vendor/bin/php-scoper add-prefix --force --output-dir=dist/vendor'
'vendor/bin/php-scoper add-prefix --force'
)
);

Expand Down
7 changes: 4 additions & 3 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function dependency_finder() {
// phpcs:enable

return array(
'prefix' => 'Sgdg\\Vendor',
'finders' => array(
'prefix' => 'Sgdg\\Vendor',
'output-dir' => 'dist/vendor',
'finders' => array(
dependency_finder()->notPath( '#^google/apiclient-services/#' ),
Finder::create()->files()
->name( 'autoload.php' )
Expand All @@ -71,7 +72,7 @@ function dependency_finder() {
->depth( 0 )
->in( 'vendor' ),
),
'patchers' => array(
'patchers' => array(
static function ( $file_path, $prefix, $contents ) {
$regex_prefix = mb_ereg_replace( '\\\\', '\\\\\\\\', $prefix );
$replace_prefix = mb_ereg_replace( '\\\\', '\\\\', $prefix );
Expand Down

0 comments on commit 3430186

Please sign in to comment.