Skip to content

Commit 4a48952

Browse files
committed
make dotenv run in quiet mode in all instances
1 parent 3b90ed6 commit 4a48952

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

examples/example-configs/multiple-contentful-environments.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { defineConfig } from '../../src/main';
33
import dotenv from 'dotenv';
44

5-
dotenv.config();
5+
dotenv.config({ quiet: true });
66

77
const isProductionEnv = process.env.SOME_ENVIRONMENT_VARIABLE === 'some-value';
88

src/helpers/contentful.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import * as contentful from 'contentful';
2-
import dotenv from 'dotenv';
32
import { ConfigContentfulSettings } from '@/main/config/types';
43

5-
dotenv.config();
6-
74
const createContentfulClient = (
85
settings: ConfigContentfulSettings,
96
previewMode = false

src/main/config/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import path from 'path';
2-
import dotenv from 'dotenv';
32
import { loadFile, checkContentfulSettings } from './fileLoader';
43
import type { ConfigContentfulSettings, ContentfulHugoConfig } from './types';
54

65
export * from './types';
76

8-
dotenv.config();
9-
107
/**
118
* Load Contentful Hugo config file
129
*/
@@ -61,6 +58,6 @@ export const loadConfig = async (
6158

6259
export const defineConfig = (
6360
config: Partial<Omit<ContentfulHugoConfig, 'contentful'>> & {
64-
contentful: Partial<ConfigContentfulSettings>;
61+
contentful?: Partial<ConfigContentfulSettings>;
6562
}
6663
) => config;

src/main/getContentType.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { ContentSettings } from '@main/index';
22
import fs from 'fs-extra';
33
import * as contentful from 'contentful';
4-
import dotenv from 'dotenv';
54
import processEntry from './processEntry';
65
import { ConfigContentfulSettings } from './config/types';
76
import { parseDirectoryPath } from './processEntry/createFile';
87

9-
dotenv.config();
10-
118
export const prepDirectory = async (
129
settings: ContentSettings
1310
): Promise<void> => {

0 commit comments

Comments
 (0)