MCPcopy
hub / github.com/angular/angular-cli / createIfMissing

Function createIfMissing

packages/schematics/angular/environments/index.ts:56–64  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

54}
55
56function createIfMissing(path: string): Rule {
57 return (tree, context) => {
58 if (tree.exists(path)) {
59 context.logger.info(`Skipping creation of already existing environment file "${path}".`);
60 } else {
61 tree.create(path, ENVIRONMENT_FILE_CONTENT);
62 }
63 };
64}
65
66function log(type: 'info' | 'warn' | 'error', text: string): Rule {
67 return (_, context) => context.logger[type](text);

Callers 1

Calls 3

existsMethod · 0.65
infoMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected