fix: dont attempt to clone is local repo is there
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			See coop-cloud/organising#247.
This commit is contained in:
		@ -2,6 +2,7 @@ package recipe
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
@ -95,13 +96,18 @@ func Get(recipeName string) (Recipe, error) {
 | 
			
		||||
	return Recipe{Name: recipeName, Config: config}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EnsureExists checks whether a recipe has been cloned locally or not.
 | 
			
		||||
// EnsureExists ensures that a recipe is locally cloned
 | 
			
		||||
func EnsureExists(recipe string) error {
 | 
			
		||||
	recipeDir := path.Join(config.ABRA_DIR, "apps", strings.ToLower(recipe))
 | 
			
		||||
 | 
			
		||||
	if _, err := os.Stat(recipeDir); os.IsNotExist(err) {
 | 
			
		||||
		logrus.Debugf("%s does not exist, attemmpting to clone", recipeDir)
 | 
			
		||||
		url := fmt.Sprintf("%s/%s.git", config.REPOS_BASE_URL, recipe)
 | 
			
		||||
		if err := gitPkg.Clone(recipeDir, url); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user