Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy directory #32

Closed
jayvdb opened this issue Jun 5, 2018 · 8 comments
Closed

Copy directory #32

jayvdb opened this issue Jun 5, 2018 · 8 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Jun 5, 2018

If a copy source is a directory, all files in it should be copied to the destination.

@chfw
Copy link
Member

chfw commented Jun 5, 2018

Recursively?

@jayvdb
Copy link
Member Author

jayvdb commented Jun 6, 2018

I hadnt thought about that.
I guess so.
We can add symbols like globs later to allow finer tuning.

@jayvdb
Copy link
Member Author

jayvdb commented Jun 21, 2018

There are also two ways to handle this.

  1. the sources are added to the target directory
  2. the target directory is emptied first, so that it only contains the source files.

Option 2 is closer to the moban meaning of a target.

Option 1 is closer to the moban meaning of a source.

Option 1 is a way to automatically deploy new templates to the target without first updating the config.

I feel option 2 is better/safer. It will be less usable/useful, as it can not be used where there are other files in the target, but it doesnt create new problems, like allowing two entries for the same target directory.

Option 1 is a feature which should be planned more carefully, and also applied to templates.

@jayvdb
Copy link
Member Author

jayvdb commented Jun 21, 2018

Option 2 has the benefit of being useful for enforcing 'empty' directories.
c.f. https://gitlab.com/coala/mobans/issues/47

chfw added a commit that referenced this issue Jul 7, 2018
@chfw
Copy link
Member

chfw commented Jul 7, 2018

With option 1, lazy copying is in place. If a file has been copied and no changes are found, the copying won't happen. So in a large tree of 100 files, initial run would cost 100 copies. In the next run, only delta changes is copied over and the costs could be: 0 - 100.

With option 2: destination folder is removed. hence the cost is constant: first run is 100 copies and Nth run is 100 copies, in previous example.

@chfw chfw closed this as completed Jul 8, 2018
@jayvdb
Copy link
Member Author

jayvdb commented Jul 11, 2018

It looks like you did option 2.

IMO option 2 should be target_dir/ source_dir/**

The only syntax I can think of that is suitable for option 1 is target_dir/ source_dir/

@chfw
Copy link
Member

chfw commented Jul 11, 2018

Will address it

@chfw chfw mentioned this issue Jul 12, 2018
chfw added a commit that referenced this issue Jul 13, 2018
@chfw
Copy link
Member

chfw commented Jul 14, 2018

released

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

No branches or pull requests

2 participants