Skip to content

Commit ca97183

Browse files
authored
FIX: write status messages to sys.stderr (#47)
writing only the rendered output to stdout allows piping to files / pbcopy with minimal editing
1 parent 5f8a4fc commit ca97183

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

github_activity/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def _cache_data(query_data, path_cache):
99
path_cache = DEFAULT_PATH_CACHE
1010
path_cache = Path(path_cache)
1111
if not path_cache.exists():
12-
print(f"Creating a new cache at {path_cache}")
12+
print(f"Creating a new cache at {path_cache}", file=sys.stderr)
1313
path_cache.mkdir()
1414

1515
for (org, repo), idata in query_data.groupby(["org", "repo"]):

github_activity/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
def main():
110110
if not _git_installed_check():
111-
print("git is required to run github-activity")
111+
print("git is required to run github-activity", file=sys.stderr)
112112
sys.exit(1)
113113

114114
args = parser.parse_args(sys.argv[1:])
@@ -136,7 +136,7 @@ def main():
136136
os.makedirs(output_dir)
137137
with open(args.output, "w") as ff:
138138
ff.write(md)
139-
print(f"Finished writing markdown to: {args.output}")
139+
print(f"Finished writing markdown to: {args.output}", file=sys.stderr)
140140
else:
141141
print(md)
142142

github_activity/github_activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def get_activity(
113113
search_query += f" type:{kind}"
114114

115115
# Query for both opened and closed issues/PRs in this window
116-
print(f"Running search query:\n{search_query}\n\n")
116+
print(f"Running search query:\n{search_query}\n\n", file=sys.stderr)
117117
query_data = []
118118
for activity_type in ["created", "closed"]:
119119
ii_search_query = (

0 commit comments

Comments
 (0)