fix: 修改 fetchself 解析器中的命令执行逻辑,简化命令构建方式以提高代码可读性
This commit is contained in:
parent
84b6d0a9e3
commit
27d5291f2b
@ -147,8 +147,7 @@ type Parser interface {
|
||||
type fastdfetchParser struct{}
|
||||
|
||||
func (p *fastdfetchParser) Parse(cmd string) (SystemInfo, error) {
|
||||
fullCmd := fmt.Sprintf("%s --color_blocks off", cmd)
|
||||
output, err := exec.Command(fullCmd).Output()
|
||||
output, err := exec.Command(cmd).Output()
|
||||
if err != nil {
|
||||
return SystemInfo{}, err
|
||||
}
|
||||
@ -223,8 +222,7 @@ func (p *fastdfetchParser) Parse(cmd string) (SystemInfo, error) {
|
||||
type neofetchParser struct{}
|
||||
|
||||
func (p *neofetchParser) Parse(cmd string) (SystemInfo, error) {
|
||||
fullCmd := fmt.Sprintf("%s --color_blocks off", cmd)
|
||||
output, err := exec.Command(fullCmd).Output()
|
||||
output, err := exec.Command(cmd, "--color_blocks", "off").Output()
|
||||
if err != nil {
|
||||
return SystemInfo{}, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user