CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-cpr

Cross-platform recursive file copying library that replicates Unix 'cp -R' command functionality

Agent Success

Agent success rate when using this tile

66%

Improvement

Agent success rate improvement when using this tile compared to baseline

1x

Baseline

Agent success rate without this tile

66%

Overview
Eval results
Files

task.mdevals/scenario-2/

Template Copier with Overwrite Control

A utility that copies a template directory into a workspace while controlling how existing files are handled and reporting the outcome.

Capabilities

Recursively copies templates

  • Copies all files and folders from a template directory into a destination, creating any missing directories, and lists the copied paths. @test

Skips conflicts when overwrite is false

  • When the destination already contains a file with different contents and overwriteExisting is false, the operation completes without replacing it, still copies non-conflicting files, and marks the conflicting destination path as skipped. @test

Replaces conflicts when overwrite is true

  • When overwriteExisting is true, an existing conflicting file at the destination is replaced with the template version while other files remain intact, and the replaced path is recorded. @test

Reports results

  • Returns a report containing absolute destination paths grouped into copied, replaced, and skipped entries for everything processed. @test

Implementation

@generates

API

export type OverwriteControlOptions = {
  overwriteExisting?: boolean;
};

export type CopyReport = {
  copied: string[];
  replaced: string[];
  skipped: { path: string; reason: "exists" | "conflict" }[];
};

export async function copyTemplate(
  templateDir: string,
  destinationDir: string,
  options?: OverwriteControlOptions
): Promise<CopyReport>;

Dependencies { .dependencies }

cpr { .dependency }

Performs cross-platform recursive copying with configurable overwrite behavior.

@satisfied-by

tessl i tessl/npm-cpr@3.0.0

tile.json