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