Files
appRobotHoming/test/fixtures/runAssignMarkerId.mjs
2026-06-17 22:57:52 +02:00

26 lines
822 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Dünner Runner für assignMarkerId wird von assignMarkerId.test.js per spawnSync aufgerufen.
*
* Argumente:
* node runAssignMarkerId.mjs <robotPath> <paramsJson>
*
* Gibt das Ergebnis als JSON-Zeile auf stdout aus.
* Wirft der Aufruf, erscheint { __error: "<message>" } + Exit 1.
*/
import { assignMarkerId } from '../../server/editRobot.js';
const [, , robotPath, paramsJson] = process.argv;
if (!robotPath || !paramsJson) {
process.stderr.write('Usage: runAssignMarkerId.mjs <robotPath> <paramsJson>\n');
process.exit(2);
}
try {
const params = JSON.parse(paramsJson);
const result = await assignMarkerId(robotPath, params);
process.stdout.write(JSON.stringify(result) + '\n');
} catch (err) {
process.stdout.write(JSON.stringify({ __error: err.message }) + '\n');
process.exit(1);
}