Skip to content

Commit 5af05a9

Browse files
committed
fix: Vender::detect parse release
In Ubuntu, ID field is `ID=ubuntu`, in CentOs, iD field is `ID="centos"`. Double quote need to be trimed.
1 parent abdde5a commit 5af05a9

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "upt"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["sigoden <sigoden@gmail.com>"]
55
edition = "2018"
66
description = "Universal pckage management tool for Windows, MacOS, Linux"

src/vendor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ impl Vendor {
6262
.lines()
6363
.find(|l| l.starts_with("ID="))
6464
.ok_or_else(|| UptError::NotSupportOS)?;
65-
let vendor = match &id[3..] {
65+
let id = id[3..].trim_matches('"');
66+
let vendor = match id {
6667
"arch" | "manjaro" => pacman::init(),
6768
"centos" | "redhat" => yum::init(),
6869
"fedora" => dnf::init(),

0 commit comments

Comments
 (0)