Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit 113fb1b

Browse files
committed
update install path
1 parent c5bf89d commit 113fb1b

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/ModuleInstaller.php

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,11 @@ class ModuleInstaller extends LibraryInstaller
1212
*/
1313
public function getInstallPath(PackageInterface $package)
1414
{
15-
$ex = explode('/', $package->getPrettyName());
16-
if (!isset($ex[1])) {
17-
throw new \InvalidArgumentException(
18-
'Unable to install Module. '
19-
.'it Should always start their package name with '
20-
.'"vendor/jarvis-"'
21-
);
15+
$parts = explode('/', $package->getPrettyName());
16+
if(count($parts) !== 2){
17+
throw new \InvalidArgumentException('The package name is incorrect for '. $package->getPrettyName());
2218
}
23-
$prefix = substr($ex[1], 0, 6);
24-
if('jarvis-' !== $prefix)
25-
{
26-
throw new \InvalidArgumentException(
27-
'Unable to install Module. '
28-
.'it Should always start their package name with '
29-
.'"vendor/jarvis-"'
30-
);
31-
}
32-
return 'modules/'.$ex[0].'/'.$ex[1];
19+
return 'modules/'.$parts[0].'/'.$parts['1'];
3320
}
3421

3522
/**

0 commit comments

Comments
 (0)