(root: string, rel: string)
| 3313 | } |
| 3314 | |
| 3315 | export async function duplicateAsset(root: string, rel: string): Promise<AssetMeta> { |
| 3316 | const source = await assertAssetFile(root, rel) |
| 3317 | const ext = path.extname(source.abs) |
| 3318 | const base = path.basename(source.abs, ext) |
| 3319 | const finalName = await uniqueFilename(path.dirname(source.abs), `${base} copy${ext}`) |
| 3320 | const destAbs = path.join(path.dirname(source.abs), finalName) |
| 3321 | await fs.copyFile(source.abs, destAbs) |
| 3322 | return await assetMetaForPath(root, destAbs) |
| 3323 | } |
| 3324 | |
| 3325 | export async function deleteAsset(root: string, rel: string): Promise<DeletedAsset> { |
| 3326 | const source = await assertAssetFile(root, rel) |
no test coverage detected