Skip to content

Commit

Permalink
deploy: remove preexisting git repos on init (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi authored Jan 14, 2019
1 parent e98268d commit c900e92
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daemon/inertiad/project/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"sync"

Expand Down Expand Up @@ -109,6 +110,9 @@ func (d *Deployment) Initialize(cfg DeploymentConfig, out io.Writer) error {
return err
}

// Remove existing git repo if there is one
os.RemoveAll(filepath.Join(d.directory, ".git"))

// Initialize repository
d.repo, err = git.InitializeRepository(cfg.RemoteURL, git.RepoOptions{
Directory: d.directory,
Expand Down

0 comments on commit c900e92

Please sign in to comment.