Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
Add the script to generate JSON input for imgsum -json-input
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.ru>
  • Loading branch information
teran committed Nov 10, 2017
1 parent eca4399 commit 969fe2b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/build-json-input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
#
# Usage:
# find <dir> -type f | build-json-input.py
#
# The script will return to STDOUT JSON document in a format for
# `imgsum -json-input`
# Designed for testing purposes.
#

import json
import sys

if __name__ == '__main__':
files = []
for line in sys.stdin:
files.append(line.strip())

print json.dumps({'files': files}, indent=4)

0 comments on commit 969fe2b

Please sign in to comment.