dotmd-cli 0.49.2 → 0.49.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/new.mjs +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotmd-cli",
3
- "version": "0.49.2",
3
+ "version": "0.49.3",
4
4
  "description": "CLI for managing markdown documents with YAML frontmatter — index, query, validate, graph, export, Notion sync, AI summaries.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/new.mjs CHANGED
@@ -366,14 +366,16 @@ export async function runNew(argv, config, opts = {}) {
366
366
  else if (bodyArg !== null) {
367
367
  bodyInput = readBodyInput(bodyArg);
368
368
  bodyInputSource = bodyArg === '-' ? 'stdin (`-`)' : (bodyArg.startsWith('@') ? `file (\`${bodyArg}\`)` : 'inline body argument');
369
- } else if (template.acceptsBody || template.requiresBody) {
369
+ } else {
370
370
  // Auto-consume piped or redirected stdin so agents don't need the `-`
371
371
  // placeholder for the most common pattern (`cat draft.md | dotmd new …`,
372
372
  // `dotmd new … < draft.md`, or a `<<'EOF'` heredoc). We probe stdin via
373
373
  // fstatSync rather than `!isTTY` so a closed/inherited fd doesn't trigger
374
374
  // a blocking read of an empty stream. We accept FIFO (shell pipes), regular
375
375
  // file (shell redirection / heredoc), and socket (Node spawnSync `input:`
376
- // delivers stdin as an AF_UNIX socket).
376
+ // delivers stdin as an AF_UNIX socket). Probe this even for templates that
377
+ // don't accept bodies so the fail-fast guard below can reject accidental
378
+ // heredoc/input instead of silently scaffolding without it.
377
379
  try {
378
380
  const stat = fstatSync(0);
379
381
  if (stat.isFIFO() || stat.isFile() || stat.isSocket()) {