Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
One-time setup that gathers your project's design context and saves it to CLAUDE.md for future sessions.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/live-target.mjs
1import path from 'node:path';2import { resolveProjectRoot } from './context.mjs';3import { parseTargetPath } from './lib/target-args.mjs';45export function resolveLiveTarget(cwd = process.cwd(), args = []) {6const originalCwd = path.resolve(cwd);7let targetPath = null;8try {9targetPath = parseTargetPath(args, { strict: true });10} catch (err) {11if (err?.name === 'TargetArgError') {12process.stderr.write(`${err.message}\n`);13process.exit(1);14}15throw err;16}17const absoluteTargetPath = targetPath18? path.isAbsolute(targetPath) ? targetPath : path.resolve(originalCwd, targetPath)19: null;20const projectRoot = targetPath21? resolveProjectRoot(originalCwd, { targetPath: absoluteTargetPath })22: originalCwd;23return {24originalCwd,25projectRoot,26targetPath,27absoluteTargetPath,28targetOptions: absoluteTargetPath ? { targetPath: absoluteTargetPath } : {},29};30}31