0

I have some files in my schematics template which should be generated only when a certain input options is present. e.g: db==true

Is there a way to skip these directories / files?

One solution is to remove them from the source using tree.delete(). However, that cannot remove dirs, only files.

What's the best way to do this:

What I want:

files/
 - file1
 - file2
 - dir // only if db==true
 ...

user2297996
  • 1,382
  • 3
  • 18
  • 28

1 Answers1

0

Figured it out:

There is no such option, but you don't need it. If you don't want a directory to be created, remove its contents from the tree using tree.delete(). Schematics won't create empty directories, so the dir will be skipped.

user2297996
  • 1,382
  • 3
  • 18
  • 28