mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-05 05:37:09 +00:00
* fix(cli): reject extra positional arguments on every command * fix(cli): read the command name without assuming a resolved meta * fix(cli): join free-text words for catalog and tts, reject a bad repo root * test(cli): load the listed commands through static imports * fix(cli): keep a tts file path out of the word join and read the parsed json flag * fix(cli): apply the file exception only to a tts .txt path * fix(cli): keep usageLine private and test the json fallback for undeclared json * fix(cli): keep extra arguments and the repo root value out of telemetry * test(cli): type the skills update lookup * fix(cli): read json mode from the parsed flag, reject tts words with --text-file, restore add's hint * fix(cli): check tts words with --text-file before --list and test --json=false
9 lines
344 B
TypeScript
9 lines
344 B
TypeScript
import { existsSync } from "node:fs";
|
|
import { extname, resolve } from "node:path";
|
|
|
|
/** True when `input` names an existing `.txt` file, which `tts` reads instead of speaking the path. */
|
|
export function isTextFile(input: string): boolean {
|
|
const path = resolve(input);
|
|
return existsSync(path) && extname(path).toLowerCase() === ".txt";
|
|
}
|