|
@@ -21,15 +21,15 @@ function composer_check_drush_command() {
|
|
|
return $cmds;
|
|
|
}
|
|
|
|
|
|
-function drush_composer_check($path = NULL) {
|
|
|
- if (empty($path)) {
|
|
|
- $path = DRUPAL_ROOT . '/composer.lock';
|
|
|
+function drush_composer_check($lockPath = NULL) {
|
|
|
+ if (empty($lockPath)) {
|
|
|
+ $lockPath = DRUPAL_ROOT . '/composer.lock';
|
|
|
}
|
|
|
- if (!is_file($path) && is_readable($path)) {
|
|
|
+ if (!is_file($lockPath) && is_readable($lockPath)) {
|
|
|
drush_die("Cannot read lock file");
|
|
|
}
|
|
|
|
|
|
- $jsonPath = dirname($path) . '/composer.json';
|
|
|
+ $jsonPath = dirname($lockPath) . '/composer.json';
|
|
|
if (!is_file($jsonPath) && is_readable($jsonPath)) {
|
|
|
drush_die("Cannot read json file");
|
|
|
}
|
|
@@ -38,7 +38,7 @@ function drush_composer_check($path = NULL) {
|
|
|
$jsonPackages = $json['require'] ?? [];
|
|
|
$jsonDevPackages = $json['require-dev'] ?? [];
|
|
|
|
|
|
- $lock = json_decode(file_get_contents($path), TRUE);
|
|
|
+ $lock = json_decode(file_get_contents($lockPath), TRUE);
|
|
|
$lockPackages = $lock['packages'];
|
|
|
$lockDevPackages = $lock['packages-dev'];
|
|
|
|