Skip to content

Commit e07b3a1

Browse files
authored
fix: ensure composer cleanup works for upcoming service namespaces (#2084)
1 parent db46cd4 commit e07b3a1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Task/Composer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ public static function cleanup(
3737
$servicesToKeep = isset($extra['google/apiclient-services']) ?
3838
$extra['google/apiclient-services'] : [];
3939
if ($servicesToKeep) {
40+
$vendorDir = $composer->getConfig()->get('vendor-dir');
4041
$serviceDir = sprintf(
4142
'%s/google/apiclient-services/src/Google/Service',
42-
$composer->getConfig()->get('vendor-dir')
43+
$vendorDir
4344
);
45+
if (!is_dir($serviceDir)) {
46+
// path for google/apiclient-services >= 0.200.0
47+
$serviceDir = sprintf(
48+
'%s/google/apiclient-services/src',
49+
$vendorDir
50+
);
51+
}
4452
self::verifyServicesToKeep($serviceDir, $servicesToKeep);
4553
$finder = self::getServicesToRemove($serviceDir, $servicesToKeep);
4654
$filesystem = $filesystem ?: new Filesystem();

0 commit comments

Comments
 (0)