scripts/check-docs-quality: avoid eager require of command-exists
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user