Skip to content

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

Merged
merged 2 commits into from
Nov 24, 2016
Merged

added logging on install #2234

merged 2 commits into from
Nov 24, 2016

Conversation

Plamen5kov
Copy link
Contributor

fixing python tests

@Plamen5kov Plamen5kov force-pushed the plamen5kov/fix_python_test branch 3 times, most recently from 3b3cf55 to 6e7a00e Compare November 17, 2016 17:45
@Plamen5kov
Copy link
Contributor Author

run CI

1 similar comment
@Plamen5kov
Copy link
Contributor Author

run CI

try {
viewResult = this.$childProcess.exec(`npm view ${packageName} ${flags}`).wait();
} catch(e) {
this.$logger.out(e);
Copy link
Contributor

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.

Copy link
Contributor Author

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) {
Copy link
Contributor

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);
Copy link
Contributor

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()) {
...
}

@Plamen5kov
Copy link
Contributor Author

run CI

@pkoleva
Copy link
Contributor

pkoleva commented Nov 22, 2016

Related issue #282

@Plamen5kov
Copy link
Contributor Author

run CI

1 similar comment
@Plamen5kov
Copy link
Contributor Author

run CI

@Plamen5kov Plamen5kov force-pushed the plamen5kov/fix_python_test branch from 49dba01 to 9148c5d Compare November 24, 2016 09:41
@Plamen5kov Plamen5kov force-pushed the plamen5kov/fix_python_test branch from 9148c5d to fc430b8 Compare November 24, 2016 11:12
@Plamen5kov Plamen5kov merged commit 1f5a0b4 into master Nov 24, 2016
@Plamen5kov Plamen5kov deleted the plamen5kov/fix_python_test branch December 8, 2016 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants