Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

add overwrite option #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

TonyStarkBy
Copy link

In some cases we don't want copy file if it exists (to save file mtime)

@@ -69,7 +70,9 @@ module.exports = function (grunt) {
} else {
dirname = el.dest;
resultPath = path.resolve(dirname, newName);
grunt.file.copy(file, resultPath);
if (!grunt.file.exists(resultPath) || options.overwrite) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep this backwards compatible, these checks should be switched

@eddiemonge
Copy link
Member

force is probably better here than overwrite but I'm fine with either

@TonyStarkBy
Copy link
Author

Why "force"? By default it will work like current version - overwrite file every time when you run task.

@eddiemonge
Copy link
Member

Actually, the check should probably be there anyway. Seems like a bug that it overwrites the file that is exactly the same

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants