Closed tommy-mitchell closed 1 year ago
That is by design (as per minimatch), to avoid accidentally copying files and folders that should not be copied (or updated, or removed, etc.). If you need to copy / update / remove those files / folders, you need to specify the dot explicitly (sandbox):
steps:
- copy: ./template/**/*
to: ./dest
- copy: ./template/**/.**/**/*
to: ./dest
- copy: ./template/**/.*
to: ./dest
- copy: ./template/**/.**/**/.*
to: ./dest
A hidden
argument could be added to copy / update / remove commands to also include hidden files and folders, though this would be a bit of an unsafe option.
Ah, I didn’t realize. I’ll try out those commands tomorrow. Thanks :)
Here’s how fast-glob
and globby
handle dot files, for reference.
That worked perfectly for copying everything, but I'm having trouble removing the empty folders now. For example, with your sandbox:
steps:
- copy: ./template/**/*
to: ./dest
- copy: ./template/**/.**/**/*
to: ./dest
- copy: ./template/**/.*
to: ./dest
- copy: ./template/**/.**/**/.*
to: ./dest
- remove: ./dest/**/*
- remove: ./dest/**/.**/**/*
- remove: ./dest/**/.*
- remove: ./dest/**/.**/**/.*
This leaves:
\__ dest/
\__ .hidden/
\__ stuff/
Ah yes, I have inadvertently introduced an issue to remove
command, where it can't remove directories any more (I need to add some e2e tests to the CLI itself 😅). Since this is a separate issue, I'll create a different issue for tracking and discussing it.
@tommy-mitchell you should be able to directly remove folders by specifying their names (again), which should? cover most use cases.
Great, that works for now :) Feel free to close this issue.
I'm gonna leave it open as I feel the current solution is a bit clunky, and adding a hidden
parameter to copy
command would be a good solution for this.
76baf4d adds a include hidden
option to copy / update / remove, to also include hidden files when a glob pattern is provided. You can access this feature from 0.2.5 upwards.
I recently tried updating a template to support copying/deleting via glob patterns (https://github.com/tommy-mitchell/cli-template), but some files are seemingly being ignored. I'm using these commands:
However, these files are not being copied or removed:
It looks like files/folders starting with a period are being ignored.