lllin000_PaperForge/node_modules/husky/bin.js
Research Assistant b4152abe10 A2: check table ownership (consumed_table_block_keys) before _SKIPPED_BODY_ROLES in render loop
Moves the block_id fetch and consumed_table_block_keys check before
_SKIPPED_BODY_ROLES so table note removal is a contract-based decision
(ownership) not a role-based accident (footnote role).

Part of table ownership contract refactor.
2026-06-25 22:27:35 +08:00

26 lines
687 B
JavaScript

#!/usr/bin/env node
import f, { writeFileSync as w } from 'fs'
import i from './index.js'
let p, a, n, s, o, d
p = process
a = p.argv[2]
if (a == 'init') {
n = 'package.json'
s = f.readFileSync(n)
o = JSON.parse(s)
;(o.scripts ||= {}).prepare = 'husky'
w(n, JSON.stringify(o, 0, /\t/.test(s) ? '\t' : 2) + '\n')
p.stdout.write(i())
try { f.mkdirSync('.husky') } catch {}
w('.husky/pre-commit', (p.env.npm_config_user_agent?.split('/')[0] ?? 'npm') + ' test\n')
p.exit()
}
d = c => console.error(`husky - ${c} command is DEPRECATED`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); p.exit(1) }
if (a == 'install') d(a)
p.stdout.write(i(a == 'install' ? undefined : a))