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

Comments

Projects
None yet
5 participants
@AdamVig

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)

@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 12, 2018

Member

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

Member

sandy081 commented Sep 12, 2018

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

@AdamVig

This comment has been minimized.

Show comment
Hide comment
@AdamVig

AdamVig 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.

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

This comment has been minimized.

Show comment
Hide comment
@ThadHouse

ThadHouse Sep 12, 2018

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.

ThadHouse commented Sep 12, 2018

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

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 13, 2018

Member

Use --force to not to show prompts

Member

sandy081 commented Sep 13, 2018

Use --force to not to show prompts

@AdamVig

This comment has been minimized.

Show comment
Hide comment
@AdamVig

AdamVig 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.

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-software that referenced this issue Sep 13, 2018

Install Atom and VSCode via snaps
Use --force to non-interactively update VSCode plugins

See Microsoft/vscode#58434
@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 14, 2018

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.

Member

sandy081 commented Sep 14, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@AdamVig

AdamVig Sep 18, 2018

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

AdamVig commented Sep 18, 2018

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

@sbatten

This comment has been minimized.

Show comment
Hide comment
@sbatten

sbatten Sep 26, 2018

Member

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.

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.

@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 26, 2018

Member

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

Member

sandy081 commented Sep 26, 2018

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

@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 26, 2018

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 26, 2018

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.

Member

sandy081 commented Sep 26, 2018

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

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 26, 2018

Member

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

Member

sandy081 commented Sep 26, 2018

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

@sandy081

This comment has been minimized.

Show comment
Hide comment
@sandy081

sandy081 Sep 26, 2018

Member

@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)

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment