This commit is contained in:
chk
2026-06-14 13:40:38 +02:00
parent e6abe047dc
commit c68ce406a6
8 changed files with 108 additions and 31 deletions

View File

@@ -10,6 +10,7 @@ const fsp = require('fs/promises');
const path = require('path');
const cfg = require('../config');
const units = require('../gcode/units');
const log = require('../log');
const { ApiError } = require('../errors');
const ID_RE = /^[a-z0-9_]+$/;
@@ -107,6 +108,7 @@ async function write(id, { name, lines, cursor = 0 }) {
const body = lines.join('\n') + (lines.length ? '\n' : '');
await fsp.writeFile(gcodePath(id), body, 'utf8');
await fsp.writeFile(jsonPath(id), JSON.stringify(meta, null, 2) + '\n', 'utf8');
log.info(`write ${gcodePath(id)} (${lines.length} Zeilen, cursor ${cursor})`);
return meta;
}