Skip to content

Commit 817891c

Browse files
author
Edward Wu
committed
Fixes acquia#2040: Assert existence of .nvmrc or .node-version.
1 parent 136b796 commit 817891c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Drush/Command/BltDoctorCommand.php

+16
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public function checkAll() {
275275
$this->checkDrupalVm();
276276
$this->checkSimpleSamlPhp();
277277
$this->checkPhpDateTimezone();
278+
$this->checkNodeVersionFileExists();
278279

279280
ksort($this->statusTable);
280281
$this->printArrayAsTable($this->statusTable);
@@ -1120,4 +1121,19 @@ protected function checkPhpDateTimezone() {
11201121
}
11211122
}
11221123

1124+
/**
1125+
* Checks that one of .nvmrc or .node-version exists in repo root.
1126+
*/
1127+
protected function checkNodeVersionFileExists() {
1128+
if (file_exists($this->repoRoot . '/.nvmrc')) {
1129+
$this->logOutcome(__FUNCTION__, ".nvmrc file exists", 'info');
1130+
}
1131+
elseif (file_exists($this->repoRoot . '/.node-version')) {
1132+
$this->logOutcome(__FUNCTION__, ".node-version file exists", 'info');
1133+
}
1134+
else {
1135+
$this->logOutcome(__FUNCTION__, "Neither .nvmrc nor .node-version file found in repo root.", 'error');
1136+
}
1137+
}
1138+
11231139
}

0 commit comments

Comments
 (0)