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-6/

Missing Directory Copier

Build a utility that copies all contents from a source template directory into a target workspace while creating any missing directories and preserving file permissions.

Capabilities

Copies into new tree

  • Copying a nested source tree into a non-existent target path creates intermediate directories and results in the target containing the same relative structure. @test

Preserves permissions

  • When a source file has a non-default mode (e.g., executable bit set), the corresponding file in the target keeps the same permissions. @test

Reports copied paths

  • On success, returns a sorted array of absolute paths for every destination file and directory created. @test

Verification flag

  • When verify is true, re-stat each copied path after completion and throw an error if any are missing; otherwise resolves with the paths. @test

Implementation

@generates

API

export async function syncTemplateTree(
  sourceDir,
  targetDir,
  options = {}
);
/**
 * @param {string} sourceDir absolute path to existing source directory
 * @param {string} targetDir absolute path to target root (may not exist)
 * @param {object} options
 * @param {boolean} [options.verify=false] when true, ensure each copied path exists after the operation
 * @returns {Promise<string[]>} absolute destination paths for files and directories, sorted
 * @throws if sourceDir is invalid, copy fails, or verification fails
 */

Dependencies { .dependencies }

cpr { .dependency }

Provides recursive copy with automatic directory creation and permission preservation.

tessl i tessl/npm-cpr@3.0.0

tile.json