code-cli 1.74.0 (new formula)

* feat: add new formula code-cli
* test: add test for code-cli
* setup livecheck for code-cli
* feat: associated version when printing help info
* test: test the binding of the version in code-cli
* style: remove redundant blank lines

Closes #117783.

Co-authored-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Mogeko 2022-12-10 01:07:45 +01:00 committed by BrewTestBot
parent fe48cee9ef
commit d8f51dfd98
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 32 additions and 0 deletions

32
Formula/code-cli.rb Normal file
View File

@ -0,0 +1,32 @@
class CodeCli < Formula
desc "Command-line interface built-in Visual Studio Code"
homepage "https://github.com/microsoft/vscode"
url "https://github.com/microsoft/vscode/archive/refs/tags/1.74.0.tar.gz"
sha256 "171435a9e2736d323af78591593f8a59eac52d26e98ba817daa37261e835aa1f"
license "MIT"
head "https://github.com/microsoft/vscode.git", branch: "main"
livecheck do
url :stable
strategy :github_latest
end
depends_on "rust" => :build
conflicts_with cask: "visual-studio-code"
def install
ENV["VSCODE_CLI_NAME_LONG"] = "Code OSS"
ENV["VSCODE_CLI_VERSION"] = version
cd "cli" do
system "cargo", "install", *std_cargo_args
end
end
test do
assert_match "Successfully removed all unused servers",
shell_output("#{bin}/code tunnel prune")
assert_match version.to_s, shell_output("#{bin}/code --version")
end
end