-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathcommand.js
More file actions
104 lines (98 loc) · 2.57 KB
/
command.js
File metadata and controls
104 lines (98 loc) · 2.57 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
'use strict';
const emberCliUpdate = require('.');
const reset = require('./reset');
const args = require('./args');
const stats = require('./stats');
const compare = require('./compare');
const codemods = require('./codemods');
module.exports = {
name: 'update',
description: 'Updates your app or addon to the latest Ember CLI version.',
works: 'insideProject',
availableOptions: [
{
name: 'package-name',
aliases: args['package-name'].alias,
description: args['package-name'].description,
type: String
},
{
name: 'blueprint',
aliases: args['blueprint'].alias,
description: args['blueprint'].description,
type: String
},
{
name: 'from',
description: args['from'].description,
type: String
},
{
name: 'to',
description: args['to'].description,
type: String,
default: args['to'].default
},
{
name: 'run-codemods',
description: args['run-codemods'].description,
type: Boolean,
default: args['run-codemods'].default
},
{
name: 'codemods-source',
description: args['codemods-source'].description,
type: String
},
{
name: 'codemods-json',
description: args['codemods-json'].description,
type: String
},
{
name: 'reset',
description: args['reset'].description,
type: Boolean,
default: args['reset'].default
},
{
name: 'compare-only',
description: args['compare-only'].description,
type: Boolean,
default: args['compare-only'].default
},
{
name: 'stats-only',
description: args['stats-only'].description,
type: Boolean,
default: args['stats-only'].default
},
{
name: 'list-codemods',
description: args['list-codemods'].description,
type: Boolean,
default: args['list-codemods'].default
}
],
async run(options) {
// eslint-disable-next-line no-console
console.warn('Running as an Ember addon is deprecated. Please run as a global install instead.');
let result;
if (options.reset) {
result = await reset(options);
} else if (options.statsOnly) {
result = await stats(options);
} else if (options.compareOnly) {
result = await compare(options);
} else if (options.listCodemods || options.runCodemods) {
result = await codemods({
...options,
list: options.listCodemods,
sourceJson: options.codemodsJson
});
} else {
result = await emberCliUpdate(options);
}
await result.promise;
}
};