alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.71k stars 163 forks source link

Install fails if run a second time #115

Closed PaulBurridge closed 6 years ago

PaulBurridge commented 6 years ago

Hi,

I am using Ansible to provision my dev environment via gantsign.visual-studio-code, I often rerun provisioning when making changes and updates but unfortunately vscode-bookmarks fails if the installer is run a 2nd time.

Would it be possible to update your install process to not fail if run twice?

TASK [gantsign.visual-studio-code : install extensions] ************************
ok: [default] => (item=({u'username': u'vagrant'}, u'HookyQR.beautify'))
ok: [default] => (item=({u'username': u'vagrant'}, u'wmaurer.change-case'))
ok: [default] => (item=({u'username': u'vagrant'}, u'ikappas.phpcs'))
ok: [default] => (item=({u'username': u'vagrant'}, u'alefragnani.project-manager'))
ok: [default] => (item=({u'username': u'vagrant'}, u'ms-vscode.sublime-keybindings'))
ok: [default] => (item=({u'username': u'vagrant'}, u'seansassenrath.vscode-theme-superonedark'))
ok: [default] => (item=({u'username': u'vagrant'}, u'robertohuertasm.vscode-icons'))
ok: [default] => (item=({u'username': u'vagrant'}, u'whatwedo.twig'))
ok: [default] => (item=({u'username': u'vagrant'}, u'Arjun.swagger-viewer'))
ok: [default] => (item=({u'username': u'vagrant'}, u'dbaeumer.vscode-eslint'))
ok: [default] => (item=({u'username': u'vagrant'}, u'bibhasdn.unique-lines'))
ok: [default] => (item=({u'username': u'vagrant'}, u'flesler.url-encode'))
ok: [default] => (item=({u'username': u'vagrant'}, u'oderwat.indent-rainbow'))
ok: [default] => (item=({u'username': u'vagrant'}, u'CoenraadS.bracket-pair-colorizer'))
failed: [default] (item=({u'username': u'vagrant'}, u'alefragnani.bookmarks')) => {"changed": true, "cmd": ["code", "--install-extension", "alefragnani.bookmarks"], "delta": "0:00:02.761653", "end": "2018-05-28 15:16:48.702877", "item": [{"username": "vagrant"}, "alefragnani.bookmarks"], "msg": "non-zero return code", "rc": 1, "start": "2018-05-28 15:16:45.941224", "stderr": "ENOTEMPTY: directory not empty, rename
'/home/vagrant/.vscode/extensions/.alefragnani.bookmarks-0.19.1' -> '/home/vagrant/.vscode/extensions/alefragnani.bookmarks-0.19.1'", "stderr_lines": ["ENOTEMPTY: directory not empty, rename '/home/vagrant/.vscode/extensions/.alefragnani.bookmarks-0.19.1' -> '/home/vagrant/.vscode/extensions/alefragnani.bookmarks-0.19.1'"], "stdout": "Found 'alefragnani.bookmarks' in the marketplace.\nInstalling...", "stdout_lines": ["Found 'alefragnani.bookmarks' in the marketplace.", "Installing..."]}
        to retry, use: --limit @/Provisioning/main.retry
alefragnani commented 6 years ago

Hi @PaulBurridge-kcom ,

The extension has no install process. The installation is entirely managed by VS Code itself, so I don't know (simply looking at your log) what is the problem.

If I understand correctly, it says directory not empty, but what does it means in the process? Which files did it detected in the folder?

I'm sorry, but I never used Ansible, and without additional info about which files are avoiding the second install, I don't know how to help.

Do you have a more verbose log to provide?

PaulBurridge commented 6 years ago

Hi,

Ansible is just running the install command, see below same issue when done manually

agrant@vm-ubuntu-18:~$ code --install-extension alefragnani.bookmarks
Found 'alefragnani.bookmarks' in the marketplace.
Installing...
Extension 'alefragnani.bookmarks' v0.19.1 was successfully installed!
vagrant@vm-ubuntu-18:~$ code --install-extension alefragnani.bookmarks
Found 'alefragnani.bookmarks' in the marketplace.
Installing...
ENOTEMPTY: directory not empty, rename '/home/vagrant/.vscode/extensions/.alefragnani.bookmarks-0.19.1' -> '/home/vagrant/.vscode/extensions/alefragnani.bookmarks-0.19.1'

None of the other extensions I use have the same issue and can be re-installed multiple times (see list in original comment above).

alefragnani commented 6 years ago

Hi @PaulBurridge-kcom ,

First of all, sorry for taking so long to answer you. It's been a busy period for me..

I could reproduce your problem, and I would say that it is related to the --install-extension command line itself, not the extension. It's a canse-sensitive issue.

The extension is called alefragnani.Bookmarks (with capital B). If you type it correctly, there is no issue, as you can see in this log:

PS C:\Users\alefr\.vscode-insiders\extensions> code-insiders --install-extension alefragnani.Bookmarks
Found 'alefragnani.Bookmarks' in the marketplace.
Installing...
Extension 'alefragnani.Bookmarks' v0.19.1 was successfully installed!
PS C:\Users\alefr\.vscode-insiders\extensions> code-insiders --install-extension alefragnani.Bookmarks
Extension 'alefragnani.Bookmarks' is already installed.
PS C:\Users\alefr\.vscode-insiders\extensions> 

As you can see, it correctly detects that the extension is already installed

BTW, I could reproduce the same issue with other extension that you listed, using an incorrect case in its name. I dare to say that it would happen for every other extension:

PS C:\Users\alefr\.vscode-insiders\extensions> code-insiders --install-extension whatwedo.Twig
Found 'whatwedo.Twig' in the marketplace.
Installing...
Extension 'whatwedo.Twig' v1.0.2 was successfully installed!
PS C:\Users\alefr\.vscode-insiders\extensions> code-insiders --install-extension whatwedo.Twig
Found 'whatwedo.Twig' in the marketplace.
Installing...
EPERM: operation not permitted, rename 'C:\Users\alefr\.vscode-insiders\extensions\.whatwedo.twig-1.0.2' -> 'C:\Users\alefr\.vscode-insiders\extensions\whatwedo.twig-1.0.2'
PS C:\Users\alefr\.vscode-insiders\extensions>

Please, fill an issue in VS Code repository, so it could be fixed by VS Code team.

Hope this helps