Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit 1f40de3

Browse files
committed
Added feature to install component as npm package in directory
mentioned in arguments
1 parent e3b5be1 commit 1f40de3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

generators/app/validator.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ validators.storeArg = async function(props) {
1717
.then(() => true)
1818
.catch(err => {
1919
return chalk.red(
20-
"Oops! We encountered an error, please see the log below for more details.\n" +
20+
`Oops! We encountered an error. Please see below for the more details - \n${chalk.yellow(
2121
err
22+
)}\nIf the directory whose path you entered already exists and you want that to be your project directory, cd into that directory and run ${chalk.cyan("`yo @biojs/biojs-webcomponents .`")}.`
2223
);
2324
});
2425
return res;
@@ -89,7 +90,7 @@ validators.checkVersionAndInstallComponent = async function(props, answers) {
8990
var res = await executeCommand(command, "version")
9091
.then(async () => {
9192
var res = await executeCommand(
92-
"npm i " + answers.packageNameToInstallComponent + "@" + props,
93+
"cd " + projectDirectory + " && npm i " + answers.packageNameToInstallComponent + "@" + props + " --save-exact",
9394
"checkVersionAndInstallComponent"
9495
)
9596
.then(() => true)

0 commit comments

Comments
 (0)