-
Notifications
You must be signed in to change notification settings - Fork 54
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 folder structure with flatten=false and ignore first levels #56
Comments
same question! |
I just came up against this myself and learned that I'm working on a shopify theme using shopify's theme kit and I want to track my custom liquid file changes separately from the rest of the theme, because dozens of other devs might mutate the theme without warning. I need to move my liquid files from To do this, I need to write a rename function: import path from 'path'
// in plugins:
copy({
targets: [
{
src: "src/liquid/**/*",
dest: "shopify-theme",
rename: (_name, _extension, fullpath) => {
const keptParts = fullpath.split(path.sep).filter(dir => {
return dir !== "src" && dir !== "liquid"
})
return path.join(...keptParts)
}
}
],
verbose: true
}) In @macaw-germany's case I think the config might look more like this: import path from 'path'
// in plugins:
copy({
targets: [
{
src: "folder2",
dest: "destfolder",
rename: (_name, _extension, fullpath) => {
const keptParts = fullpath.split(path.sep).filter(dir => {
return dir !== "folder2"
})
return path.join(...keptParts)
}
}
],
verbose: true
}) |
Assuming your structure is always consistent, you can also simply use a |
are there some updates on this issue? |
I need to copy a folder structure (so flatten=false is necessary), but do not want to have the full path in destination.
Example:
If the folder1/folder2 structure looks like this:
I need this in destination folder:
Instead, I get this (since the source folder gets copied in addition except the first one):
Is this possible with the copy plugin at all?
The text was updated successfully, but these errors were encountered: