Skip to content

Commit

Permalink
Fix infinite pull
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriiklymiuk committed May 30, 2024
1 parent 083f1ab commit d6a9212
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func runPull(cmd *cobra.Command, _ []string) {
if err != nil {
fmt.Println(err)
}
isRunOnce, err := cmd.Root().Flags().GetBool("runOnce")
if err != nil {
return
}
for _, service := range corgi.Services {
corgiComposeExists, err := utils.CheckIfFileExistsInDirectory(
service.AbsolutePath,
Expand All @@ -41,8 +45,8 @@ func runPull(cmd *cobra.Command, _ []string) {
}

var pullCmdToExecute string
if corgiComposeExists {
pullCmdToExecute = "corgi pull --silent"
if corgiComposeExists && !isRunOnce {
pullCmdToExecute = "corgi pull --silent --runOnce"
} else {
pullCmdToExecute = "git pull"
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

var APP_VERSION = "1.5.5"
var APP_VERSION = "1.5.6"

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Expand Down

0 comments on commit d6a9212

Please sign in to comment.