Support exact versions for `vscode` plugins
sobolevn opened this issue · comments
Hi! Thanks a lot for supporting vscode
in Brewfile
, this is really helpful.
Right now brew
dumps all plguins without their versions, but sometimes vscode
plugins require a specific version due to some changes in them.
vscode
already support installing specific versions of plugins and listing the version.
Right now I have to skip vscode
in Brewfile
and keep a separate file with code --install-extension 'ext@version'
calls. Which is not very convenient :(
My proposal is:
- Let's add a CLI flag for it: something like
--vscode-with-versions
(orHOMEBREW_BUNDLE_VSCODE_VERSION=true
env var) - Add
--show-versions
here: https://github.com/Homebrew/homebrew-bundle/blob/743f2aad47601c1e162f0ff05219d5a0bb15e0ad/lib/bundle/vscode_extension_dumper.rb#L13C10-L13C32 if the flag is set
It should just work after that:
--install-extension <ext-id | path> Installs or updates an extension. The argument is
either an extension id or a path to a VSIX. The
identifier of an extension is
'${publisher}.${name}'. Use '--force' argument to
update to latest version. To install a specific
version provide '@${version}'. For example:
'vscode.csharp@1.2.3'.
What do others think?
this goes against Homebrew and homebrew/bundle in general so very unlikely and not something I can see being included. see the note in the README on versions for more details.
As a workaround you can just do that manually:
#!/usr/bin/env bash
set -e
# Brewfile does not support dumping exact versions by default.
# So, here are some exact versions of plugins that I use
# (when I care about the version).
sd -s 'vscode "teabyii.ayu"' 'vscode "teabyii.ayu@0.20.2"' Brewfile
echo 'Brewfile updated'
This can be added to pre-commit
hooks as well.
Works like a charm :)