Skip to content

Commit

Permalink
Merge pull request Yelp#69 from guykisel/check-stdin
Browse files Browse the repository at this point in the history
Only load json from stdin if it exists
  • Loading branch information
KevinHock authored Aug 9, 2018
2 parents d7f6297 + f113250 commit 49dc178
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion detect_secrets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def _get_existing_baseline(import_filename):
if import_filename:
return _read_from_file(import_filename[0])
if not sys.stdin.isatty():
return json.loads(sys.stdin.read())
stdin = sys.stdin.read().strip()
if stdin:
return json.loads(stdin)


def _read_from_file(filename):
Expand Down

0 comments on commit 49dc178

Please sign in to comment.