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%
Replace a destination workspace with a fresh snapshot of a source directory by clearing the destination tree before copying.
@generates
Use the dependency to perform the recursive copy while clearing the destination before each run rather than manually deleting paths one by one.
/**
* Replace the contents of destinationDir with a fresh copy of sourceDir.
* @param {string} sourceDir absolute or relative path to the source snapshot.
* @param {string} destinationDir absolute or relative path to the destination to refresh.
* @returns {Promise<string[]>} sorted list of destination file and directory paths that exist after the refresh.
* @throws {Error} when the refresh fails or sourceDir cannot be read.
*/
export async function refreshWorkspace(sourceDir, destinationDir);Recursively copies files and directories and can clear a destination tree before copying.
@satisfied-by
tessl i tessl/npm-cpr@3.0.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10