Skip to content

Commit

Permalink
fix: install command
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrgl committed Jul 23, 2022
1 parent 6b3c116 commit 948e6f9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cmd/install.go
Expand Up @@ -35,16 +35,24 @@ func init() {
}

func buildAndAdd(fp string) error {
cmd := exec.Command("go", "build", "-o", binariesDir(filepath.Base(fp)), fp)
err := cmd.Run()
os.Chdir(fp)
cmdDownload := exec.Command("go", "mod", "download")
cmdDownload.Stdout = os.Stdout
cmdDownload.Stderr = os.Stderr
err := cmdDownload.Run()
if err != nil {
return err
}
return nil
cmdBuild := exec.Command("go", "build", "-o", filepath.Join("../bin", filepath.Base(fp)))
cmdBuild.Stdout = os.Stdout
cmdBuild.Stderr = os.Stderr
return cmdBuild.Run()
}

func Install(g *Game) error {
fp := gameoverDir(g.Name)
os.RemoveAll(fp)

_, err := git.PlainClone(fp, false, &git.CloneOptions{
URL: g.Repo,
})
Expand Down

0 comments on commit 948e6f9

Please sign in to comment.