fix: source certificates into Gatsby (#39648)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f132f5157c
commit
4b14f9297b
@ -1,9 +1,11 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
function createChallengeNode(challenge, reporter) {
|
||||
// challengeType 11 is for video challenges (they only have instructions)
|
||||
// challengeType 7 is for certificates (they only have tests)
|
||||
if (
|
||||
typeof challenge.description[0] !== 'string' &&
|
||||
challenge.challengeType !== 11
|
||||
(challenge.challengeType !== 11 && challenge.challengeType !== 7)
|
||||
) {
|
||||
reporter.warn(`
|
||||
|
||||
@ -17,7 +19,7 @@ function createChallengeNode(challenge, reporter) {
|
||||
.digest('hex');
|
||||
const internal = {
|
||||
contentDigest,
|
||||
type: 'ChallengeNode'
|
||||
type: challenge.challengeType === 7 ? 'CertificateNode' : 'ChallengeNode'
|
||||
};
|
||||
|
||||
/* eslint-disable prefer-object-spread/prefer-object-spread */
|
||||
@ -26,13 +28,13 @@ function createChallengeNode(challenge, reporter) {
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
id: challenge.id + ' >>>> ChallengeNode',
|
||||
children: [],
|
||||
parent: null,
|
||||
internal,
|
||||
sourceInstanceName: 'challenge'
|
||||
},
|
||||
challenge
|
||||
challenge,
|
||||
{ id: challenge.id + internal.type }
|
||||
)
|
||||
)
|
||||
);
|
||||
|
Reference in New Issue
Block a user