starkk92
starkk92

Reputation: 5924

how to use gulp to move a directory with a depth of more than one

I am new to gulp.

I have a directory in /src which I want to move to /dist.

My directory looks like this with a depth of more than 1.

folder1
   - folder2
       -folder4
          -folder5
              -folder6
          -folder7
              -folder8
                  -folder10
              -folder9
   - folder3

I have declared src path as /src/folder1/* in gulp file and it has moved only folder1,folder2,folder3 to the destination path.folder2 and folder3 are empty folders which is perfectly fine.

I have declared src path as /src/folder/** in gulp file and it has moved all the folders as expected to the destination path.And while I was going through all the folders in destination path after running gulpfile, it crashed with segmentation11.What is the reason for this?

And what is the actual method to move all the folders of above structure in gulp?

Upvotes: 0

Views: 113

Answers (1)

This is the behavior of node-glob which gulp uses under the hood. From their readme:

  • * Matches 0 or more characters in a single path portion

  • ..

  • ** If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories.

* will match everything in the same directory.

** will match everything recursively (subdirectories).

The segmentation fault is most likely due to a flaw in your script.

Upvotes: 1

Related Questions