Skip to content

Commit

Permalink
Implement 'test' folder
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLich committed Oct 30, 2021
1 parent a6fd7a1 commit bf7b0d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regolith/git_getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions regolith/remote_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf7b0d2

Please sign in to comment.