mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 09:50:08 +00:00
* chore: Upgrade Go module to v2 Signed-off-by: jannfis <jann@mistrust.net> * Restore import order Signed-off-by: jannfis <jann@mistrust.net> * fix knowntypes_normalizer codegen error Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> * fix codegen Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> * fix Procfile Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
27 lines
574 B
Go
27 lines
574 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 git-ask-pass.sh shell script
|
|
func NewBinDirToPath() AddBinDirToPath {
|
|
originalPath := os.Getenv("PATH")
|
|
binDir, err := filepath.Abs("../../hack")
|
|
errors.CheckError(err)
|
|
err = os.Setenv("PATH", fmt.Sprintf("%s:%s", originalPath, binDir))
|
|
errors.CheckError(err)
|
|
return AddBinDirToPath{originalPath}
|
|
}
|