Skip to content

Commit 6796680

Browse files
committed
do not load and validate content if cmsName is not 'git'
1 parent 8bacbd1 commit 6796680

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ export function printSSGMatchResult(ssgMatchResult: SSGMatchResult | null) {
77
console.log(`Couldn't match SSG`);
88
return;
99
}
10-
console.log(`Matched SSG: ${chalk.blueBright(ssgMatchResult.ssgName)}`);
10+
console.log(`Matched SSG: ${chalk.cyanBright(ssgMatchResult.ssgName)}`);
1111
if (ssgMatchResult.ssgDir === undefined) {
1212
const possibleDirs = ssgMatchResult.options?.ssgDirs ? ` Possible folders: ${ssgMatchResult.options?.ssgDirs.join(', ')}` : '';
1313
console.log('Could not identify SSG folder.' + possibleDirs);
1414
} else {
1515
const ssgDir = ssgMatchResult.ssgDir === '' ? '.' : ssgMatchResult.ssgDir;
16-
console.log(`SSG directory: ${chalk.blueBright(`'${ssgDir}'`)}`);
17-
console.log(`Repo is theme: ${chalk.blueBright(!!ssgMatchResult.isTheme)}`);
16+
console.log(`SSG directory: ${chalk.cyanBright(`'${ssgDir}'`)}`);
17+
console.log(`Repo is theme: ${chalk.cyanBright(!!ssgMatchResult.isTheme)}`);
1818
if (ssgMatchResult.envVars) {
19-
console.log(`Environment variables: ${chalk.blueBright(`${ssgMatchResult.envVars.join(', ')}`)}`);
19+
console.log(`Environment variables: ${chalk.cyanBright(`${ssgMatchResult.envVars.join(', ')}`)}`);
2020
}
2121
}
2222
}
@@ -25,10 +25,10 @@ export function printCMSMatchResult(cmsMatchResult: CMSMatchResult | null) {
2525
if (!cmsMatchResult) {
2626
return;
2727
}
28-
console.log(`Matched CMS: ${chalk.blueBright(cmsMatchResult.cmsName)}`);
28+
console.log(`Matched CMS: ${chalk.cyanBright(cmsMatchResult.cmsName)}`);
2929
if (cmsMatchResult.cmsData !== undefined) {
3030
_.forEach(cmsMatchResult.cmsData, (value, prop) => {
31-
console.log(`${prop}: ${chalk.blueBright(`'${value}'`)}`);
31+
console.log(`${prop}: ${chalk.cyanBright(`'${value}'`)}`);
3232
});
3333
}
3434
}

src/validate.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export async function validate({ inputDir, configOnly, quiet }: ValidateOptions)
3636
return;
3737
}
3838

39+
// do not load or validate content if cmsName is not git
40+
const cmsName = configResult.config.cmsName ?? 'git';
41+
if (cmsName !== 'git') {
42+
return;
43+
}
44+
3945
const contentResult = await validateContent({
4046
dirPath: inputDir,
4147
config: configResult.config,

0 commit comments

Comments
 (0)