Skip to content
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

CLI install extension command cannot run non-interactively #58434

Closed
AdamVig opened this issue Sep 11, 2018 · 13 comments · Fixed by #58591
Closed

CLI install extension command cannot run non-interactively #58434

AdamVig opened this issue Sep 11, 2018 · 13 comments · Fixed by #58591
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-cli VS Code Command line issues

Comments

@AdamVig
Copy link

AdamVig commented Sep 11, 2018

  • VSCode Version: 1.27.1
  • OS Version: MacOS 10.13.6

I have found that I am unable to reliably install extensions via the command line because of an update prompt that requires user interaction. A flag like --yes or --force or --update would be helpful in allowing the --install-extension command to run non-interactively.

Steps to Reproduce:

  1. code --install-extension yzhang.markdown-all-in-one (or any extension that has a newer version than the one you have installed)
  2. Prompt appears: Extension 'yzhang.markdown-all-in-one' v1.6.0 is already installed, but a newer version 1.6.1 is available in the marketplace. Would you like to update? Yes(0) | No(1)

Does this issue occur when all extensions are disabled?: Yes (CLI command)

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Sep 11, 2018
@sandy081 sandy081 added the feature-request Request for new features or functionality label Sep 12, 2018
@sandy081 sandy081 modified the milestone: September 2018 Sep 12, 2018
@sandy081
Copy link
Member

@AdamVig May I know the use case why do you want to run this non interactively?

@sandy081 sandy081 added under-discussion Issue is under discussion for relevance, priority, approach and removed feature-request Request for new features or functionality labels Sep 12, 2018
@AdamVig
Copy link
Author

AdamVig commented Sep 12, 2018

@sandy081 Thanks for the reply.

I use the VS Code CLI to install extensions in my dotfiles. Managing my extensions in my dotfiles helps keep them in sync between my personal and work computers.

You can see the script that uses the CLI here.

@ThadHouse
Copy link

I agree that the CLI should have a way to run every command, especially extension based commands without interaction. I also have an installer that is installing a list of VS Code extensions, and while I haven't directly seen this issue yet, it would be a major issue if it did.

@sandy081 sandy081 added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Sep 13, 2018
@sandy081 sandy081 added this to the September 2018 milestone Sep 13, 2018
@sandy081 sandy081 added the workbench-cli VS Code Command line issues label Sep 13, 2018
@sandy081
Copy link
Member

Use --force to not to show prompts

@sandy081 sandy081 added the verification-needed Verification of issue is requested label Sep 13, 2018
@AdamVig
Copy link
Author

AdamVig commented Sep 13, 2018

@sandy081 Based on the code I could see in the pull request, it looks like this may prevent the code --install-extension command from updating already-installed extensions.

Is that the case? If so, they will be updated through some other mechanism, correct?

edit: I installed VS Code Insiders and will verify that the feature works for me when it arrives in the insiders build.

bittner added a commit to painless-software/ansible-role-software that referenced this issue Sep 13, 2018
Use --force to non-interactively update VSCode plugins

See microsoft/vscode#58434
@sandy081
Copy link
Member

@AdamVig No, it will not prevent. If there is an update and you pass --force command, I would skip prompting and install the extension directly.

@AdamVig
Copy link
Author

AdamVig commented Sep 18, 2018

I was able to verify that the fix is working for me. Thanks @sandy081 for jumping on this!

@sbatten
Copy link
Member

sbatten commented Sep 26, 2018

I opened a related issue #59481 when testing this. However, I can actually repro that same issue when taking a previously installed extension and just updating its package.json to be an older version, making this issue broken or at least unverifiable for me.

@sbatten sbatten added verification-found Issue verification failed and removed verification-needed Verification of issue is requested verified Verification succeeded labels Sep 26, 2018
@sbatten sbatten reopened this Sep 26, 2018
@sandy081
Copy link
Member

@sbatten May I know if you reopened this issue because of #59481 or is there something else not working here?

@sandy081
Copy link
Member

sandy081 commented Sep 26, 2018

I can reproduce the error you see in #59481 and it is happening only in windows. Not sure if it is necessary to have both issues open. Is it ok to close the other one and track it here?

@sandy081
Copy link
Member

I think let's have them separate. This issue is for allow installing / updating extension without any prompt and other issue should show the prompt while updating.

@sandy081
Copy link
Member

@sbatten Did you try updating the extension using --force argument here?

@sandy081
Copy link
Member

sandy081 commented Sep 26, 2018

@sbatten --force argument updates the extension without any prompts on Windows. Closing this. Please do verify.

Let's track the prompts related issue in the other one you created (#59481)

@sandy081 sandy081 added verification-needed Verification of issue is requested and removed verification-found Issue verification failed labels Sep 26, 2018
@mjbvz mjbvz added the verified Verification succeeded label Sep 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-cli VS Code Command line issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants