MCPcopy Create free account
hub / github.com/LOLINTERNETZ/vscodeoffline / first_file

Method first_file

vscoffline/vsc.py:149–157  ·  view source on GitHub ↗
(filepath: Union[str, pathlib.Path], pattern: str, reverse: bool = False)

Source from the content-addressed store, hash-verified

147
148 @staticmethod
149 def first_file(filepath: Union[str, pathlib.Path], pattern: str, reverse: bool = False) -> Union[str, bool]:
150 if isinstance(filepath, str):
151 filepath = pathlib.Path(filepath)
152 results = [*filepath.glob(pattern)]
153 if not results:
154 return False
155 elif len(results) >= 1 and reverse:
156 results.sort(reverse=True)
157 return str(results[0].absolute())
158
159 @staticmethod
160 def folders_in_folder(filepath: str) -> List[str]:

Callers 2

on_getMethod · 0.80
on_getMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected