Skip to content

Incorrect default for glob copy options.overwrite #136

@pettinen

Description

@pettinen

When copying, options.overwrite should default to true, as documented

overwrite: {
description: 'overwrite existing file or directory',
type: 'boolean',
default: true,
},

However when the copy source is a glob and overwrite is not specified, fsExtra.copy is called with { overwrite: undefined }, which fs-extra interprets as { overwrite: false }:

const copyOptions = {
overwrite: mergedOptions.overwrite,
preserveTimestamps: mergedOptions.preserveTimestamps,
};

This is also an undocumented breaking change between v8.0.0 and v9.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions