From 3ae79881e39385704cf2e728146b4501a96f1e4c Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Thu, 1 Feb 2024 09:01:18 +0900 Subject: [PATCH] feat(cargo): trim a prefix from cargo package's version (#2652) --- pkg/installpackage/cargo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/installpackage/cargo.go b/pkg/installpackage/cargo.go index c6e9c7952..bcfb4ccc6 100644 --- a/pkg/installpackage/cargo.go +++ b/pkg/installpackage/cargo.go @@ -71,7 +71,7 @@ func (is *Installer) downloadCargo(ctx context.Context, logE *logrus.Entry, pkg } logE.Info("Installing a crate") crate := pkg.PackageInfo.Crate - version := pkg.Package.Version + version := strings.TrimPrefix(strings.TrimPrefix(pkg.Package.Version, pkg.PackageInfo.VersionPrefix), "v") if err := is.cargoPackageInstaller.Install(ctx, logE, crate, version, root, cargoOpts); err != nil { return fmt.Errorf("cargo install: %w", err) }