generated from Seekra/repository-template
fix(build): add check whether artifact has options
This commit is contained in:
@@ -21,6 +21,7 @@ import { dirname, join } from 'node:path';
|
|||||||
const validateArtifact = function validateArtifact (artifact) {
|
const validateArtifact = function validateArtifact (artifact) {
|
||||||
if (typeof artifact.path !== 'string') return false;
|
if (typeof artifact.path !== 'string') return false;
|
||||||
if (artifact.type === 'text') {
|
if (artifact.type === 'text') {
|
||||||
|
if (!artifact.options) return false;
|
||||||
return (
|
return (
|
||||||
typeof artifact.options.content === 'string' &&
|
typeof artifact.options.content === 'string' &&
|
||||||
(
|
(
|
||||||
@@ -29,6 +30,7 @@ const validateArtifact = function validateArtifact (artifact) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (artifact.type === 'copy') {
|
} else if (artifact.type === 'copy') {
|
||||||
|
if (!artifact.options) return false;
|
||||||
return typeof artifact.options.source === 'string';
|
return typeof artifact.options.source === 'string';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user