From 11ab8ba7b66d7743168b5f36a3f985cbd0c18b8d Mon Sep 17 00:00:00 2001 From: im6 Date: Fri, 28 Feb 2020 21:53:16 -0500 Subject: [PATCH] add env checker in collect task --- src/collect/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/collect/index.js b/src/collect/index.js index 3ec9438..4ecd0f6 100644 --- a/src/collect/index.js +++ b/src/collect/index.js @@ -3,6 +3,11 @@ import collectGit from './task/git'; import collectSite from './task/site'; import { viewModelPath } from '../config'; +if (!process.env.SQL_HOST) { + console.error('DB connection info missing.'); // eslint-disable-line no-console + process.exit(); +} + const gitOutputPath = path.join(process.cwd(), viewModelPath.git); const siteOutputPath = path.join(process.cwd(), viewModelPath.site);