Closed thePanz closed 7 years ago
Hi! I deliberately didn't implement a recursive delete, it's too risky. The idea of the FS tasks is to move/copy/remove configuration files needed for a deployment.
I understand that it may be needed, for example remove a cache directory (when not using releases), so perhaps the best option here is to create a new task "remove-dir" which will test that the target is a directory.
Why would it be dangerous? just the rsync command is even replacing files, why removing a folder is considered harmful?
I think there is a need for parameterization in general! For example: I need cp -a src/. dest/
to move whole directories.
So an optional flags parameter would be nice (defaulting to the current parameters) like: - fs/copy: { from: 'from/.', to: 'to/', flags: '-a' }
A deployment script should be flexible and providing the tools for it is not harmful in my opinion.
+1 to adding flags!
@thePanz regarding the harmfulness of the command, think about a user that misconfigures the command and ends with something like rm -rf /
, that's my main concern.
On the other hand I think @mbaeuerle nailed it with the flags, we are already using that in many other commands, and the user will have to thoughtfully add it.
I've created issue #344 so I can address this in the next release ;)
See #340