From 0c0f6d579072e2c3148aa5a7de43f19291045a2e Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Thu, 2 Feb 2023 15:43:44 +0000 Subject: [PATCH] fixed sync for single repo --- utils/sync.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/sync.go b/utils/sync.go index 5b4f997..9ac0e46 100644 --- a/utils/sync.go +++ b/utils/sync.go @@ -6,11 +6,12 @@ import ( ) func Sync(repoName ...string) error { - var _repoName string - if len(repoName) > 0 { - _repoName = repoName[0] - } - c := exec.Command("emerge", "--sync", _repoName) + c := exec.Command("emerge", "--sync") c.Stdout = os.Stdout + + if len(repoName) > 0 && len(repoName[0]) > 0 { + c.Args = append(c.Args, repoName[0]) + } + return c.Run() }