scripts/check-docs-quality: avoid eager require of command-exists

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-04-27 20:26:19 +02:00
parent edc718e2de
commit 92d6e673e7
+1 -2
View File
@@ -15,7 +15,6 @@
*/
const { spawnSync } = require('child_process');
const { resolve: resolvePath, join: joinPath } = require('path');
const commandExists = require('command-exists');
const fs = require('fs').promises;
const IGNORED = [
@@ -56,7 +55,7 @@ async function listFiles(dir = '') {
// caused by the script. In CI, we want to ensure vale linter is run.
async function exitIfMissingVale() {
try {
await commandExists('vale');
await require('command-exists')('vale');
} catch (e) {
if (process.env.CI) {
console.log(