Last active
October 24, 2018 12:36
-
-
Save bautistaaa/c4a737e123dee434d5be3ed16bb40ccb to your computer and use it in GitHub Desktop.
schematic to add vscode files to your project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addVsCodeSettings(): Rule { | |
| return (tree: Tree, _context: SchematicContext) => { | |
| const templateSource = apply(url('./files/.vscode'), [ | |
| move('./.vscode'), | |
| forEach((fileEntry: FileEntry) => { | |
| if (tree.exists(fileEntry.path)) { | |
| _context.logger.warn(`Warning: you've overriden ${ | |
| fileEntry.path | |
| }. If you did not mean | |
| to do this, restore these files via source control immediately after this operation.`); | |
| tree.overwrite(fileEntry.path, fileEntry.content); | |
| } | |
| return fileEntry; | |
| }), | |
| ]); | |
| return branchAndMerge(chain([mergeWith(templateSource)])); | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment