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
 ...

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.