piral-cli
Version:
The standard CLI for creating and building a Piral instance or a Pilet.
27 lines • 843 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
/**
* Checks that the scripts defined for pilets are valid.
*/
function default_1(context, options = undefined) {
const { scripts } = context.info;
if (typeof scripts !== 'object') {
context.error(`
The scripts in pilets.scripts are invalid.
Expected: <object>.
Received: <${typeof scripts}>.
`);
}
else {
const invalidScripts = Object.keys(scripts).filter((key) => typeof scripts[key] !== 'string');
if (invalidScripts.length > 0) {
context.error(`
The scripts in pilets.scripts are invalid.
Expected: Only commands (<string>) in the array.
Received: Found ${invalidScripts.length} invalid entries.
`);
}
}
}
//# sourceMappingURL=piral-has-valid-scripts.js.map