mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
refactor: use argocd-git-ask-pass to pass git credentials to git/kustomize (#8516) Signed-off-by: Alexander Matyushentsev <[email protected]>
28 lines
559 B
Go
28 lines
559 B
Go
package path
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
|
|
"github.com/argoproj/argo-cd/v2/util/errors"
|
|
)
|
|
|
|
type AddBinDirToPath struct {
|
|
originalPath string
|
|
}
|
|
|
|
func (h AddBinDirToPath) Close() {
|
|
_ = os.Setenv("PATH", h.originalPath)
|
|
}
|
|
|
|
// add the hack path which has the argocd binary
|
|
func NewBinDirToPath() AddBinDirToPath {
|
|
originalPath := os.Getenv("PATH")
|
|
binDir, err := filepath.Abs("../../dist")
|
|
errors.CheckError(err)
|
|
err = os.Setenv("PATH", fmt.Sprintf("%s:%s", originalPath, binDir))
|
|
errors.CheckError(err)
|
|
return AddBinDirToPath{originalPath}
|
|
}
|