MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / setOptions

Method setOptions

packages/cli/lib/project-generator.js:114–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 async setOptions() {
115 await super.setOptions();
116 if (this.shouldExit()) return false;
117 if (this.options.name) {
118 const msg = utils.validate(this.options.name);
119 if (typeof msg === 'string') {
120 this.exit(msg);
121 return false;
122 }
123 }
124
125 this.projectInfo = {
126 projectType: this.projectType,
127 dependencies: utils.getDependencies(),
128 };
129 this.projectOptions = [
130 'name',
131 'description',
132 'outdir',
133 'private',
134 'apiconnect',
135 ].concat(this.buildOptions);
136 this.projectOptions.forEach(n => {
137 if (typeof n === 'object') {
138 n = n.name;
139 }
140 if (this.options[n]) {
141 this.projectInfo[n] = this.options[n];
142 }
143 });
144 }
145
146 promptProjectName() {
147 if (this.shouldExit()) return false;

Callers

nothing calls this directly

Calls 3

shouldExitMethod · 0.80
validateMethod · 0.80
exitMethod · 0.80

Tested by

no test coverage detected