Azure / Azure/autorest.cli

[Bug] Autorest cli doesn't install extensions correctly on first try.

Open
#112 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Please see versions on the screenshots.

Reproduction scenario:
1. Make sure extension is removed from /.autorest . In my example I'm using @microsoft.azure/autorest.java@3.0.1 @microsoft.azure/autorest.modeler@2.3.51 extensions.
2. Execute `autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280`
![image](https://user-images.githubusercontent.com/61715331/77105604-26ec5c00-69db-11ea-9de5-eaa84ca1f4d2.png)
3. Execute `autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280` **again**
![image](https://user-images.githubusercontent.com/61715331/77105658-3b305900-69db-11ea-9c89-dd1e06888b63.png)
4. Execute `autorest --use=@microsoft.azure/autorest.java@3.0.1 --use=@microsoft.azure/autorest.modeler@2.3.51 --version=2.0.4280` **again**
![image](https://user-images.githubusercontent.com/61715331/77105936-94988800-69db-11ea-810e-ec3555e82456.png)

Bottom line is that Autorest fails when extension is pulled first time with such error:
```
Loading AutoRest core 'C:\Users\kasobol.REDMOND\.autorest\@microsoft.azure_autorest-core@2.0.4280\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4280)
Loading AutoRest extension '@microsoft.azure/autorest.java' (3.0.1->3.0.1)
Installing AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.51)
TypeError: Cannot read property 'filename' of undefined
at /node_modules/npm/node_modules/npm-lifecycle/index.js:66:39
at /node_modules/npm/node_modules/npm-lifecycle/index.js:186:12
at /node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:154:5)
```
Second attempt is successful. In my example I pulled two fresh extensions hence I worked on 3rd attempt...

Please fix that.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.