diff options
author | ZeLibertineGamer <zlg@zlg.space> | 2016-05-23 03:34:58 -0700 |
---|---|---|
committer | Ze Libertine Gamer <zlg@zlg.space> | 2016-05-23 03:34:58 -0700 |
commit | fc4d160b55a2ec86b6f048b16f5c89d4cecfcb4e (patch) | |
tree | 91a88519a0cbb5774f2e691ac1d8b84e589497f3 | |
parent | Fix example command (diff) | |
download | vgstash-fc4d160b55a2ec86b6f048b16f5c89d4cecfcb4e.tar.gz vgstash-fc4d160b55a2ec86b6f048b16f5c89d4cecfcb4e.tar.bz2 vgstash-fc4d160b55a2ec86b6f048b16f5c89d4cecfcb4e.tar.xz vgstash-fc4d160b55a2ec86b6f048b16f5c89d4cecfcb4e.zip |
Add duplicate game reporting script
It'll serve as an example of how vgstash can be extended with minimal
effort.
-rwxr-xr-x | scripts/dupe-finder.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/dupe-finder.sh b/scripts/dupe-finder.sh new file mode 100755 index 0000000..9ffae6d --- /dev/null +++ b/scripts/dupe-finder.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# dupe-finder.sh: Output duplicate games in your database + +# We're setting the envvar here to enforce the -w argument to uniq +result=$(VGSTASH_TABLE_WIDTH=80 vgstash list | uniq -D -f 2 -w 58) +if [[ -z $result ]]; then + exit +else + VGSTASH_TABLE_WIDTH=80 vgstash list | head -n 2 + echo "$result" +fi |