MCPcopy Index your code
hub / github.com/devspace-sh/devspace / removeSomeTestFilesAndFolders

Function removeSomeTestFilesAndFolders

pkg/devspace/sync/sync_test.go:618–653  ·  view source on GitHub ↗
(local string, remote string, filesToCheck testCaseList, foldersToCheck testCaseList, removeSuffix string)

Source from the content-addressed store, hash-verified

616}
617
618func removeSomeTestFilesAndFolders(local string, remote string, filesToCheck testCaseList, foldersToCheck testCaseList, removeSuffix string) (testCaseList, testCaseList, error) {
619 var completeSuffix string
620 removeIfSuffixMatch := func(path string, f os.FileInfo, err error) error {
621 if strings.HasSuffix(path, completeSuffix) {
622 return os.RemoveAll(path)
623 }
624 return nil
625 }
626
627 completeSuffix = "Remote" + removeSuffix
628 err := filepath.Walk(remote, removeIfSuffixMatch)
629 if err != nil {
630 return nil, nil, err
631 }
632 completeSuffix = "Local" + removeSuffix
633 err = filepath.Walk(local, removeIfSuffixMatch)
634 if err != nil {
635 return nil, nil, err
636 }
637
638 for n, f := range filesToCheck {
639 if strings.HasSuffix(f.path, removeSuffix) {
640 filesToCheck[n].shouldExistInLocal = false
641 filesToCheck[n].shouldExistInRemote = false
642 }
643 }
644
645 for n, f := range foldersToCheck {
646 if strings.HasSuffix(f.path, removeSuffix) {
647 foldersToCheck[n].shouldExistInLocal = false
648 foldersToCheck[n].shouldExistInRemote = false
649 }
650 }
651
652 return filesToCheck, foldersToCheck, nil
653}
654
655func renameSomeTestFilesAndFolders(local string, remote string, outside string, filesToCheck testCaseList, foldersToCheck testCaseList) (testCaseList, testCaseList, error) {
656 for n, array := range []testCaseList{filesToCheck, foldersToCheck} {

Callers 1

TestNormalSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected