-
-
Notifications
You must be signed in to change notification settings - Fork 197
added logging on install #2234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added logging on install #2234
Conversation
3b3cf55
to
6e7a00e
Compare
run CI |
1 similar comment
run CI |
try { | ||
viewResult = this.$childProcess.exec(`npm view ${packageName} ${flags}`).wait(); | ||
} catch(e) { | ||
this.$logger.out(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason to catch the error, print it and throw it again? In case npm view
is used in a command, CLI's commandsService will print the error when it's thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is temporary, it will failWithoutHelp
@@ -70,6 +70,14 @@ export class NpmInstallationManager implements INpmInstallationManager { | |||
|
|||
private installCore(packageName: string, pathToSave: string, version: string, dependencyType: string): IFuture<string> { | |||
return (() => { | |||
if(packageName.indexOf(".") === 0 || packageName.indexOf(".tgz") >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fail in case user passes path without ./
in front, for example in case I want to install local directory I can pass ./my-dir
or my-dir
. Both will work
@@ -70,6 +70,14 @@ export class NpmInstallationManager implements INpmInstallationManager { | |||
|
|||
private installCore(packageName: string, pathToSave: string, version: string, dependencyType: string): IFuture<string> { | |||
return (() => { | |||
if(packageName.indexOf(".") === 0 || packageName.indexOf(".tgz") >= 0) { | |||
let cwd = process.cwd(); | |||
let possiblePackageName = path.join(`${cwd}`, packageName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this you can use path.resolve(packageName)
- this will work with both full and relative paths. In this case you can skip the above if as well and use:
const possiblePackageName= path.resolve(packageName);
if (this.$fs.exists(possiblePackageName).wait()) {
...
}
run CI |
Related issue #282 |
run CI |
1 similar comment
run CI |
49dba01
to
9148c5d
Compare
…/remove_npm2_dependency"" This reverts commit a60eabd.
9148c5d
to
fc430b8
Compare
fixing python tests