#!/bin/bash # Seeds the empty run workspace with a small home-library CLI (Node, node --test). # Self-contained on purpose: the run cannot read the eval directory, and the # fixture is written inline, with no path outside the workspace and no git. set -eu mkdir -p src bin tests cat > package.json <<'J' { "name": "shelf", "version": "0.2.0", "type": "module", "private": true, "bin": { "shelf": "bin/shelf.mjs" }, "scripts": { "test": "node --test", "lint": "node --check src/books.mjs" } } J cat > src/books.mjs <<'J' // A tiny home-library catalogue kept in a JSON file. import { readFileSync, writeFileSync, existsSync } from 'node:fs'; export function load(path) { return existsSync(path) ? JSON.parse(readFileSync(path, 'utf8')) : []; } export function save(path, books) { writeFileSync(path, JSON.stringify(books, null, 2) + '\n'); } export function add(books, { title, author }) { if (!title) throw new Error('title is required'); return [...books, { title, author: author ?? 'unknown', added: new Date().toISOString().slice(0, 10) }]; } J cat > bin/shelf.mjs <<'J' #!/usr/bin/env node // shelf add "