/**
 * Shared shell escaping utilities.
 *
 * Use these only when building commands that intentionally pass through
 * a shell (e.g. `sh -lc "…"`). Prefer execFileSync with argument arrays
 * to avoid needing shell escaping in the first place.
 */

/**
 * Wrap a value in single quotes and escape any embedded single quotes
 * so it can be safely interpolated into a POSIX shell command string.
 */
export function shellEscapeArg(value: string): string {
  return `'${value.replace(/'/g, "'\\''")}'`;
}
