Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Problems with preinstall #294

Open
tnoonan-salesforce opened this issue Sep 28, 2017 · 1 comment
Open

Problems with preinstall #294

tnoonan-salesforce opened this issue Sep 28, 2017 · 1 comment

Comments

@tnoonan-salesforce
Copy link

@jdxcode was trying out this the preinstall change.

I'm running into erratic async behavior with it.

In the most simple case I have this:
async function preinstall(config: any, {plugin, tag}: {plugin: any, tag: string}): Promise {
return new Promise((resolve, reject) => {
console.log("1");
console.log("2");
reject(new Error("Fail install"));
});
}
export = preinstall;

And this results in

$ bin/run plugins:install cli-engine-example-plugin
Installing plugin cli-engine-example-plugin...
1
Installing plugin cli-engine-example-plugin... !
▸ Fail install
$

Note that "2" in never printed and "Installing plugin cli-engine-example-plugin..." is printed twice.

Ideas? I'm using node 8.5.0

@tnoonan-salesforce
Copy link
Author

Same issue if I remove all notion of async...

function preinstall(config: any, {plugin, tag}: {plugin: any, tag: string}) {
console.log("1");
console.log("2");
throw new Error("Fail install");
}
export = preinstall;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant