Homebrew / homebrew-bundle

📦 Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask and the Mac App Store.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

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