fix(schematics): fix create-nx-workspace to respect the --directory
This commit is contained in:
parent
e21caa0143
commit
da9310e9db
@ -34,6 +34,16 @@ xdescribe('CreateNxWorkspace', () => {
|
|||||||
1000000
|
1000000
|
||||||
);
|
);
|
||||||
|
|
||||||
|
it(
|
||||||
|
'should create a new workspace with the --directory option',
|
||||||
|
() => {
|
||||||
|
const res = createNxWorkspace('myproj --npmScope=myscope --directory=proj');
|
||||||
|
expect(res).toContain("Project 'myproj' successfully created.");
|
||||||
|
checkFilesExist('package-lock.json');
|
||||||
|
},
|
||||||
|
1000000
|
||||||
|
);
|
||||||
|
|
||||||
it(
|
it(
|
||||||
'should error when no name is given',
|
'should error when no name is given',
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@ -65,8 +65,11 @@ execSync(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const dir = process.argv.filter(a => a.startsWith('-dir') || a.startsWith('--directory'))[0];
|
||||||
|
const cwd = dir ? dir.split('=')[1] : projectName;
|
||||||
|
|
||||||
if (useYarn) {
|
if (useYarn) {
|
||||||
execSync(`yarn install`, { stdio: [0, 1, 2], cwd: projectName });
|
execSync(`yarn install`, { stdio: [0, 1, 2], cwd });
|
||||||
} else {
|
} else {
|
||||||
execSync(`npm install`, { stdio: [0, 1, 2], cwd: projectName });
|
execSync(`npm install`, { stdio: [0, 1, 2], cwd });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user