MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / run

Function run

lib/commands/destroy.js:50–100  ·  view source on GitHub ↗
(commandOptions, rawArgs)

Source from the content-addressed store, hash-verified

48 beforeRun: mergeBlueprintOptions,
49
50 run(commandOptions, rawArgs) {
51 if (this.isViteProject && commandOptions.dummy) {
52 return Promise.reject(
53 new SilentError('The `--dummy` option to `ember destroy` is not supported in Vite-based projects.')
54 );
55 }
56
57 let blueprintName = rawArgs[0];
58 let entityName = rawArgs[1];
59
60 if (!blueprintName) {
61 return Promise.reject(
62 new SilentError(
63 'The `ember destroy` command requires a ' +
64 'blueprint name to be specified. ' +
65 'For more details, use `ember help`.'
66 )
67 );
68 }
69
70 if (!entityName) {
71 return Promise.reject(
72 new SilentError(
73 'The `ember destroy` command requires an ' +
74 'entity name to be specified. ' +
75 'For more details, use `ember help`.'
76 )
77 );
78 }
79
80 let taskArgs = {
81 args: rawArgs,
82 };
83
84 if (this.settings && this.settings.usePods && !commandOptions.classic) {
85 commandOptions.pod = true;
86 }
87
88 if (commandOptions.in) {
89 let relativePath = path.relative(this.project.root, commandOptions.in);
90 commandOptions.in = path.resolve(relativePath);
91 }
92
93 let taskOptions = merge(taskArgs, commandOptions || {});
94
95 if (this.project.initializeAddons) {
96 this.project.initializeAddons();
97 }
98
99 return this.runTask('DestroyFromBlueprint', taskOptions);
100 },
101
102 printDetailedHelp() {
103 let ui = this.ui;

Callers

nothing calls this directly

Calls 1

initializeAddonsMethod · 0.45

Tested by

no test coverage detected