@lukasbach/scripts

find

Search a script by name

Usage

npx @lukasbach/scripts find

You can call the script directly if you have installed it globally:

npm i -g @lukasbach/scripts
ldo find

Options

  • --script: Search for a script:
  • -v, --verbose: Verbose logging

You can also omit options, and will be asked for them interactively.

Add --yes to skip all confirmations.

Script source

View Source on GitHub

/** Search a script by name */
import { getScriptPaths, resolveScriptData } from "./internal/utils.js";

const scripts = Object.values(await resolveScriptData(await getScriptPaths())).filter((s) => !s.isInternal);

const found = await ask.choice(
  "script",
  "Search for a script:",
  scripts.map((s) => s.command)
);

if (!found) {
  process.exit(0);
}

await utils.runScript(found);