(commandOptions, rawArgs)
| 86 | beforeRun: mergeBlueprintOptions, |
| 87 | |
| 88 | async run(commandOptions, rawArgs) { |
| 89 | deprecate( |
| 90 | "Don't use `--embroider` option. Use `-b @ember/app-blueprint` instead.", |
| 91 | !commandOptions.embroider, |
| 92 | DEPRECATIONS.EMBROIDER.options |
| 93 | ); |
| 94 | |
| 95 | if (commandOptions.dryRun) { |
| 96 | commandOptions.skipNpm = true; |
| 97 | } |
| 98 | |
| 99 | let project = this.project; |
| 100 | let packageName = (commandOptions.name !== '.' && commandOptions.name) || project.name(); |
| 101 | let ciProvider = commandOptions.ciProvider; |
| 102 | |
| 103 | if (!packageName) { |
| 104 | let message = |
| 105 | `The \`ember ${this.name}\` command requires a ` + |
| 106 | `package.json in current folder with name attribute or a specified name via arguments. ` + |
| 107 | `For more details, use \`ember help\`.`; |
| 108 | |
| 109 | return Promise.reject(new SilentError(message)); |
| 110 | } |
| 111 | |
| 112 | if (commandOptions.lang) { |
| 113 | commandOptions.lang = getLangArg(commandOptions.lang, this.ui); |
| 114 | } |
| 115 | |
| 116 | if (commandOptions.packageManager === undefined && project.isEmberCLIProject()) { |
| 117 | if (await isPnpmProject(project.root)) { |
| 118 | commandOptions.packageManager = 'pnpm'; |
| 119 | } else if (isYarnProject(project.root)) { |
| 120 | commandOptions.packageManager = 'yarn'; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | let blueprintOpts = clone(commandOptions); |
| 125 | let blueprint = normalizeBlueprint(blueprintOpts.blueprint || this._defaultBlueprint()); |
| 126 | |
| 127 | merge(blueprintOpts, { |
| 128 | rawName: packageName, |
| 129 | targetFiles: rawArgs || [], |
| 130 | rawArgs: rawArgs.toString(), |
| 131 | blueprint, |
| 132 | ciProvider, |
| 133 | }); |
| 134 | |
| 135 | let { targetFiles } = blueprintOpts; |
| 136 | |
| 137 | deprecate( |
| 138 | `Do not pass file names or globs to \`init\`. Passed: "${targetFiles.join(' ')}"`, |
| 139 | targetFiles.length === 0, |
| 140 | DEPRECATIONS.INIT_TARGET_FILES.options |
| 141 | ); |
| 142 | |
| 143 | if (!isValidProjectName(packageName)) { |
| 144 | return Promise.reject(new SilentError(`We currently do not support a name of \`${packageName}\`.`)); |
| 145 | } |
nothing calls this directly
no test coverage detected