Skip to content

Commit 8a06c18

Browse files
author
Kelly Selden
committed
use --name when init plus scope
1 parent 6a3e14e commit 8a06c18

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ function getArgs({
103103
args.push('-sg');
104104
} else {
105105
args.push('init');
106+
if (directoryName !== projectName) {
107+
args.push(`--name=${projectName}`);
108+
}
106109
}
107110

108111
let _blueprint;

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ describe(_getStartAndEndCommands, function() {
817817
]);
818818
});
819819

820-
it('works for scoped project', function() {
820+
it('works for scoped project - base', function() {
821821
let blueprint = loadDefaultBlueprint(['welcome']);
822822

823823
let args = getArgs({
@@ -837,6 +837,26 @@ describe(_getStartAndEndCommands, function() {
837837
]);
838838
});
839839

840+
it('works for scoped project - partial', function() {
841+
let blueprint = loadSafeBlueprint({
842+
path: '/path/to/my-blueprint'
843+
});
844+
845+
let args = getArgs({
846+
projectName: `@my-scope/${projectName}`,
847+
blueprint
848+
});
849+
850+
expect(args).to.deep.equal([
851+
'init',
852+
`--name=@my-scope/${projectName}`,
853+
'-sn',
854+
'-sb',
855+
'-b',
856+
'/path/to/my-blueprint'
857+
]);
858+
});
859+
840860
it('works for custom base blueprint', function() {
841861
let blueprint = loadSafeBlueprint({
842862
path: '/path/to/my-blueprint',

0 commit comments

Comments
 (0)