Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fixes #2040: Assert existence of .nvmrc or .node-version. #2042

Merged
merged 1 commit into from
Sep 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Drush/Command/BltDoctorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public function checkAll() {
$this->checkDrupalVm();
$this->checkSimpleSamlPhp();
$this->checkPhpDateTimezone();
$this->checkNodeVersionFileExists();

ksort($this->statusTable);
$this->printArrayAsTable($this->statusTable);
Expand Down Expand Up @@ -1120,4 +1121,19 @@ protected function checkPhpDateTimezone() {
}
}

/**
* Checks that one of .nvmrc or .node-version exists in repo root.
*/
protected function checkNodeVersionFileExists() {
if (file_exists($this->repoRoot . '/.nvmrc')) {
$this->logOutcome(__FUNCTION__, ".nvmrc file exists", 'info');
}
elseif (file_exists($this->repoRoot . '/.node-version')) {
$this->logOutcome(__FUNCTION__, ".node-version file exists", 'info');
}
else {
$this->logOutcome(__FUNCTION__, "Neither .nvmrc nor .node-version file found in repo root.", 'error');
}
}

}