This repository has been archived on 2023-01-27. You can view files and clone it, but cannot push or open issues or pull requests.
cad/commands/sw.js
2022-10-15 19:16:08 +02:00

31 lines
1.6 KiB
JavaScript

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = void 0;
const debug = require("../log");
const argv_1 = require("../argv");
const index_1 = require("../cad/index");
const OSR_REGEX = /^[0-9].+$/;
const isOSR = (filename) => filename.match(OSR_REGEX) != null;
// SolidWorks base converter, using powershell & interop interface (pkgdir/sw)
let options = (yargs) => argv_1.defaultOptions(yargs);
// node ./build/main.js sw --src=../plastichub/products/elena/cad --glob="*.SLDASM" --format="step" --dst="../test"
exports.register = (cli) => {
return cli.command('sw', '', options, (argv) => __awaiter(void 0, void 0, void 0, function* () {
if (argv.help) {
return;
}
const options = argv_1.sanitize(argv);
options.debug && debug.inspect("options " + argv.dst, options);
return index_1.convert(options);
}));
};
//# sourceMappingURL=sw.js.map