Skip to content

Commit

Permalink
tidy: add check for 0 size files
Browse files Browse the repository at this point in the history
  • Loading branch information
alama committed Nov 10, 2016
1 parent f438e59 commit dc3f02c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jq-tidy.sh
@@ -1,2 +1,6 @@
#!/bin/sh
cat $1 | jq --tab -r -M '.' | cat > new/$1
size=$(du -k new/$1 | cut -f 1)
if [ $size -ne "0" ]; then
mv new/$1 $1
fi
1 change: 0 additions & 1 deletion tidy-json.sh
@@ -1,5 +1,4 @@
#!/bin/sh
mkdir -p new/json
find json -maxdepth 1 -name "*.txt" -exec ./jq-tidy.sh {} \;
mv new/json/*.txt json
rm -rf new

0 comments on commit dc3f02c

Please sign in to comment.