@tywalk/pcf-helper
Version:
Command line helper for building and publishing PCF controls to Dataverse.
19 lines (18 loc) • 750 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildBeforeAll = buildBeforeAll;
const child_process_1 = require("child_process");
function buildBeforeAll() {
var _a;
const npmExecPath = process.env.npm_execpath;
if (!npmExecPath) {
throw new Error('Unable to locate npm executable path from npm_execpath.');
}
const build = (0, child_process_1.spawnSync)(process.execPath, [npmExecPath, 'run', 'build'], {
cwd: process.cwd(),
encoding: 'utf-8'
});
if (build.status !== 0) {
throw new Error(`Failed to build pcf-helper before CLI tests.\n${((_a = build.error) === null || _a === void 0 ? void 0 : _a.message) || build.stderr || build.stdout}`);
}
}