1 | 'use strict';
|
2 |
|
3 | const debug = require('debug')('ember-try:commands:try-ember');
|
4 |
|
5 | module.exports = {
|
6 | name: 'try:ember',
|
7 | description:
|
8 | 'Runs with each Ember version matching the semver statement given. The command defaults to `ember test`',
|
9 | works: 'insideProject',
|
10 |
|
11 | anonymousOptions: ['<ember-semver-statement>'],
|
12 |
|
13 | availableOptions: [
|
14 | { name: 'skip-cleanup', type: Boolean, default: false },
|
15 | { name: 'config-path', type: String },
|
16 | ],
|
17 |
|
18 | _getConfig: require('../utils/config'),
|
19 | _TryEachTask: require('../tasks/try-each'),
|
20 |
|
21 | async run(commandOptions, rawArgs) {
|
22 | let emberVersion = rawArgs[0];
|
23 |
|
24 | debug('Options:\n', commandOptions);
|
25 | debug('Ember semver statement', emberVersion);
|
26 |
|
27 | let config = await this._getConfig({
|
28 | project: this.project,
|
29 | configPath: commandOptions.configPath,
|
30 | versionCompatibility: {
|
31 | ember: emberVersion,
|
32 | },
|
33 | });
|
34 |
|
35 | debug('Config: %s', JSON.stringify(config));
|
36 |
|
37 | let tryEachTask = new this._TryEachTask({
|
38 | ui: this.ui,
|
39 | project: this.project,
|
40 | config,
|
41 | });
|
42 |
|
43 | return await tryEachTask.run(config.scenarios, { skipCleanup: commandOptions.skipCleanup });
|
44 | },
|
45 | };
|