cli-engine icon indicating copy to clipboard operation
cli-engine copied to clipboard

Problems with preinstall

Open tnoonan-salesforce opened this issue 7 years ago • 1 comments

@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 avatar Sep 28 '17 15:09 tnoonan-salesforce

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;

tnoonan-salesforce avatar Sep 28 '17 15:09 tnoonan-salesforce