Skip to content

Commit f81ee3a

Browse files
author
Kelly Selden
committed
refactor getArgs to take an object
1 parent 1ce8c69 commit f81ee3a

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

src/get-start-and-end-commands.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ async function isDefaultAddonBlueprint(blueprint) {
8787
return isDefaultAddonBlueprint;
8888
}
8989

90-
function getArgs(projectName, blueprint) {
90+
function getArgs({
91+
projectName,
92+
blueprint
93+
}) {
9194
let args = [];
9295

9396
if (blueprint.isBaseBlueprint) {
@@ -147,7 +150,10 @@ async function runEmberLocally({
147150
projectName,
148151
blueprint
149152
}) {
150-
let args = getArgs(projectName, blueprint);
153+
let args = getArgs({
154+
projectName,
155+
blueprint
156+
});
151157

152158
if (!blueprint.isBaseBlueprint) {
153159
cwd = path.join(cwd, projectName);
@@ -166,7 +172,10 @@ async function runEmberRemotely({
166172
}) {
167173
let isCustomBlueprint = !isDefaultBlueprint(blueprint);
168174

169-
let args = getArgs(projectName, blueprint);
175+
let args = getArgs({
176+
projectName,
177+
blueprint
178+
});
170179

171180
if (!blueprint.isBaseBlueprint) {
172181
cwd = path.join(cwd, projectName);

test/unit/get-start-and-end-commands-test.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,10 @@ describe(_getStartAndEndCommands, function() {
760760
it('works for default app', function() {
761761
let blueprint = loadDefaultBlueprint(['welcome']);
762762

763-
let args = getArgs(projectName, blueprint);
763+
let args = getArgs({
764+
projectName,
765+
blueprint
766+
});
764767

765768
expect(args).to.deep.equal([
766769
'new',
@@ -776,7 +779,10 @@ describe(_getStartAndEndCommands, function() {
776779
it('works for default addon', function() {
777780
let blueprint = loadDefaultBlueprint(['addon']);
778781

779-
let args = getArgs(projectName, blueprint);
782+
let args = getArgs({
783+
projectName,
784+
blueprint
785+
});
780786

781787
expect(args).to.deep.equal([
782788
'new',
@@ -796,7 +802,10 @@ describe(_getStartAndEndCommands, function() {
796802
isBaseBlueprint: true
797803
});
798804

799-
let args = getArgs(projectName, blueprint);
805+
let args = getArgs({
806+
projectName,
807+
blueprint
808+
});
800809

801810
expect(args).to.deep.equal([
802811
'new',
@@ -814,7 +823,10 @@ describe(_getStartAndEndCommands, function() {
814823
path: '/path/to/my-blueprint'
815824
});
816825

817-
let args = getArgs(projectName, blueprint);
826+
let args = getArgs({
827+
projectName,
828+
blueprint
829+
});
818830

819831
expect(args).to.deep.equal([
820832
'init',
@@ -834,7 +846,10 @@ describe(_getStartAndEndCommands, function() {
834846
]
835847
};
836848

837-
let args = getArgs(projectName, blueprint);
849+
let args = getArgs({
850+
projectName,
851+
blueprint
852+
});
838853

839854
expect(args).to.deep.equal([
840855
'new',

0 commit comments

Comments
 (0)