vscode-motoko icon indicating copy to clipboard operation
vscode-motoko copied to clipboard

Update mops and call `mops sources` with `--no-install` flag

Open ZenVoich opened this issue 1 year ago • 3 comments

Sometimes errors may occur when a user runsmops install because ext calls mops sources which starts with mops install, so we get two concurrent install processes. With --no-install flag this problem should go away.

ZenVoich avatar Aug 02 '24 07:08 ZenVoich

Thanks for the fix! How recently was the --no-install flag added to Mops? Since the extension uses an externally installed Mops version (rather than the version bundled with the extension), we could adjust the error message to encourage updating Mops if the command is unsuccessful.

rvanasa avatar Aug 02 '24 16:08 rvanasa

Here is what I'm imagining (updating the error message slightly below the original code change):

throw new Error(
    `Error while finding Mops packages.\nMake sure the latest version of Mops is installed locally or globally (https://mops.one/docs/install).\n${err?.message || err}`,
);

The CI error should be fixable by running npm install in case that saves you a bit of time.

rvanasa avatar Aug 02 '24 16:08 rvanasa

How recently was the --no-install flag added to Mops? Since the extension uses an externally installed Mops version (rather than the version bundled with the extension), we could adjust the error message to encourage updating Mops if the command is unsuccessful.

In 0.45.0 a week ago. Maybe we should give it a time so fewer users encounter errors...

Here is what I'm imagining (updating the error message slightly below the original code change):

The CI error should be fixable by running npm install in case that saves you a bit of time.

Done

ZenVoich avatar Aug 05 '24 08:08 ZenVoich

Added mops version check

ZenVoich avatar Aug 15 '24 07:08 ZenVoich

I just got a chance to check back on this. Thanks for the update! Merged.

rvanasa avatar Sep 23 '24 16:09 rvanasa