Skip to content

Commit

Permalink
fix: Git outputs should be language agnostic. (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Junkern authored Mar 15, 2023
1 parent cf2f7ff commit 45786d7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/app/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ func checkoutSourceCode(baseDir string, gitURL string, version string) string {

// Clean the repository
logrus.Infof("Resetting %s and pulling latest changes", fullPath)
executeBashCommand("git reset --hard && git clean -d -f -q", fullPath)
executeBashCommand("git remote show origin | sed -n '/HEAD branch/s/.*: //p'| xargs git checkout && git pull", fullPath)

err = w.Reset(&git.ResetOptions{Mode: git.HardReset})
CheckIfError(err)
err = w.Clean(&git.CleanOptions{Dir: true})
CheckIfError(err)
executeBashCommand("LC_ALL=C git remote show origin | sed -n '/HEAD branch/s/.*: //p'| xargs git checkout && git pull", fullPath)

if len(version) > 0 {
logrus.Infof("Checking out %s", version)
Expand Down

0 comments on commit 45786d7

Please sign in to comment.