adowu commited on
Commit
c5a8b0c
1 Parent(s): 483d941

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -214,7 +214,13 @@ def github_tool(
214
  if not all([owner, repo_name]):
215
  raise ValueError("Brakujące parametry: owner, repo_name")
216
  repo = g.get_repo(f"{owner}/{repo_name}")
217
- contents = repo.get_contents(path)
 
 
 
 
 
 
218
  files = [{'name': content.name, 'path': content.path,
219
  'download_url': content.download_url} for content in contents]
220
  return files
 
214
  if not all([owner, repo_name]):
215
  raise ValueError("Brakujące parametry: owner, repo_name")
216
  repo = g.get_repo(f"{owner}/{repo_name}")
217
+
218
+ # Dodaj obsługę pustej ścieżki:
219
+ if not path:
220
+ contents = repo.get_contents("") # Pobierz zawartość głównego katalogu
221
+ else:
222
+ contents = repo.get_contents(path)
223
+
224
  files = [{'name': content.name, 'path': content.path,
225
  'download_url': content.download_url} for content in contents]
226
  return files