diff --git a/catcli/noder.py b/catcli/noder.py index d20d5d0..104a95a 100644 --- a/catcli/noder.py +++ b/catcli/noder.py @@ -487,11 +487,8 @@ class Noder: for item in found: typcast_node(item) item.name = fix_badchars(item.name) - storage = item.get_storage_node() - parents = item.get_parent_hierarchy() - parent_key = f'{storage.name}/{parents}' - key = f'{parent_key}/{item.name}' - paths[parent_key] = item + key = get_node_fullpath(item) + paths[key] = item # handle fzf mode if fmt.startswith('fzf'): @@ -549,6 +546,8 @@ class Noder: return True if term in path: return True + if self.debug: + Logger.debug(f'match \"{path}\" with \"{term}\"') if fnmatch.fnmatch(path, term): return True diff --git a/tests-ng/assets/github.catalog.csv.txt b/tests-ng/assets/github.catalog.csv.txt index 1cb0158..4e415e9 100644 --- a/tests-ng/assets/github.catalog.csv.txt +++ b/tests-ng/assets/github.catalog.csv.txt @@ -1,6 +1,6 @@ "github","storage","","1662","","","","3","0","0","" -"FUNDING.yml","file","github/FUNDING.yml","17","","","0c6407a84d412c514007313fb3bca4de","","","","" -"codecov.yml","file","github/codecov.yml","104","","","4203204f75b43cd4bf032402beb3359d","","","","" -"workflows","dir","github/workflows","0","","","","2","","","" -"pypi-release.yml","file","github/workflows/pypi-release.yml","691","","","57699a7a6a03e20e864f220e19f8e197","","","","" -"testing.yml","file","github/workflows/testing.yml","850","","","691df1a4d2f254b5cd04c152e7c6ccaf","","","","" +"FUNDING.yml","file","github/","17","","","0c6407a84d412c514007313fb3bca4de","","","","" +"codecov.yml","file","github/","104","","","4203204f75b43cd4bf032402beb3359d","","","","" +"workflows","dir","github/","0","","","","2","","","" +"pypi-release.yml","file","github/","691","","","57699a7a6a03e20e864f220e19f8e197","","","","" +"testing.yml","file","github/","850","","","691df1a4d2f254b5cd04c152e7c6ccaf","","","","" diff --git a/tests-ng/assets/github.catalog.json b/tests-ng/assets/github.catalog.json index e7159ab..d4fcf58 100644 --- a/tests-ng/assets/github.catalog.json +++ b/tests-ng/assets/github.catalog.json @@ -44,14 +44,14 @@ "name": "github", "size": 1662, "total": 0, - "ts": 1704747820, + "ts": 1704750073, "type": "storage" }, { "attr": { - "access": 1704747820, + "access": 1704750073, "access_version": "0.9.6", - "created": 1704747820, + "created": 1704750073, "created_version": "0.9.6" }, "name": "meta", diff --git a/tests-ng/find.sh b/tests-ng/find.sh index ad690d8..c356b36 100755 --- a/tests-ng/find.sh +++ b/tests-ng/find.sh @@ -44,10 +44,12 @@ echo "" ${bin} -B ls -r --catalog="${catalog}" +echo "finding \"testing.yml\"" ${bin} -B find --catalog="${catalog}" testing.yml cnt=$(${bin} -B find --catalog="${catalog}" testing.yml | wc -l) [ "${cnt}" != "2" ] && echo "should return 2 (not ${cnt})" && exit 1 +echo "finding \"*.yml\"" ${bin} -B find --catalog="${catalog}" '*.yml' cnt=$(${bin} -B find --catalog="${catalog}" '*.yml' | wc -l) [ "${cnt}" != "8" ] && echo "should return 8 (not ${cnt})" && exit 1