Skip to content

Commit e7ad8e9

Browse files
committed
Updates
1 parent 55fe187 commit e7ad8e9

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

good_first_issues/commands/search.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ def search(
118118

119119
# Spinner
120120
spinner = Halo(text="Fetching repos...", spinner="dots")
121-
# spinner.start()
121+
spinner.start()
122122

123123
# API Call
124124
response = services.caller(token, query, variables)
125-
breakpoint()
126125

127126
spinner.succeed("Repos fetched.")
128127

good_first_issues/graphql/services.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,31 @@ def identify_mode(
151151
query = core_query
152152
variables["searchQuery"] = f"user:{name} {base_variable}"
153153
mode = "user"
154-
else:
155-
# if CLI gets not flag, defaults to looking into org repos.
156-
query = core_query
157-
variables["searchQuery"] = f"org:{name} {base_variable}"
158-
mode = "org"
159-
160-
if hacktoberfest and not repo:
154+
elif name and hacktoberfest and not repo:
161155
query = search_query
162-
variables["queryString"] = "topic:hacktoberfest "
163-
if name:
164-
variables["queryString"] += f"user:{name}"
156+
search_query_var = "topic:hacktoberfest"
157+
if period:
158+
search_query_var = f"{search_query_var} created:>={period} org:{name}"
159+
variables["queryString"] = search_query_var
165160
mode = "search"
166-
167-
if repo and hacktoberfest:
161+
elif hacktoberfest and not repo:
162+
query = search_query
163+
search_query_var = "topic:hacktoberfest"
164+
if period:
165+
search_query_var = f"{search_query_var} created:>={period} user:{name}"
166+
variables["queryString"] = search_query_var
167+
mode = "search"
168+
elif repo and hacktoberfest:
168169
console.print(
169170
"Error: --hacktoberfest or --hf cannot be used with --repo flag:x:",
170171
style="bold red",
171172
)
172173
sys.exit()
174+
else:
175+
# if CLI gets not flag, defaults to looking into org repos.
176+
query = core_query
177+
variables["searchQuery"] = f"org:{name} {base_variable}"
178+
mode = "org"
173179

174180
return query, variables, mode
175181

0 commit comments

Comments
 (0)