@methodus/contracts
Version:
This package is part of the Methodus tollbelt. It's purpose is generating contract packages of the server code, to be used by JavaScript browser / server clients.
26 lines • 798 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Installer = void 0;
const shelljs = require("shelljs");
const exec = require("shelljs.exec");
class Installer {
constructor(configuration) {
this.configuration = configuration;
this.shell = shelljs;
}
publish(destFolder) {
const cwd = process.cwd();
this.shell.cd(destFolder);
let commandStr = `${this.configuration.runner} pack`;
if (process.env.YARN) {
commandStr = 'yarn pack';
}
if (exec(commandStr).code !== 0) {
this.shell.cd(cwd);
throw (new Error('could not publish contract'));
}
this.shell.cd(cwd);
}
}
exports.Installer = Installer;
//# sourceMappingURL=installer.js.map