diff --git a/regolith/git_getter.go b/regolith/git_getter.go index f4974807..44a26bfa 100644 --- a/regolith/git_getter.go +++ b/regolith/git_getter.go @@ -77,7 +77,7 @@ func DownloadGitHubUrl(url string, localPath string) (bool, error) { return false, wrapError(fmt.Sprintf("Failed to fetch the tree %s: %s", leaf.Path, data.Message), err) } for _, l := range data.Tree { - if l.Type == "blob" { + if l.Type == "blob" && l.Path != "test" { err := downloadLeaf(l, localPath) if err != nil { return false, wrapError(fmt.Sprintf("Failed to download the leaf %s", l.Path), err) diff --git a/regolith/remote_filters.go b/regolith/remote_filters.go index 891c27ab..b300488c 100644 --- a/regolith/remote_filters.go +++ b/regolith/remote_filters.go @@ -126,6 +126,17 @@ func InstallDependency(profile Profile, isForced bool) error { } } + // Remove 'test' folder, which may be installed via git-getter library + // This is a workaround for cases where our own getter library is not + // able to download the filter. + testFolder := path.Join(downloadPath, "test") + if _, err := os.Stat(testFolder); err == nil { + os.RemoveAll(testFolder) + if err != nil { + Logger.Debug("Could not remove test folder", err) + } + } + // Move filters 'data' folder contents into 'data' filterName := strings.Split(path.Clean(url), "/")[3] localDataPath := path.Join(profile.DataPath, filterName)