From 3069437cc22b364952f79ba6aa3321fce2d01df5 Mon Sep 17 00:00:00 2001 From: Martin Potier Date: Wed, 16 Mar 2016 15:59:01 +0100 Subject: [PATCH] Small coverage tool (percent of saved config) --- coverage | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 coverage diff --git a/coverage b/coverage new file mode 100755 index 0000000..10b7eba --- /dev/null +++ b/coverage @@ -0,0 +1,10 @@ +#!/bin/bash + +DOTFILESINHOME=$(find ~/ -maxdepth 1 -type f -iname '.*rc' | wc -l) +DOTFILESINCONF=$(find ~/.config -maxdepth 1 -type d | wc -l) +SAVEDDOTFILES=$(ls -d ~/dotfiles | wc -l) + +TOTALDOTFILES=$(echo "$DOTFILESINCONF + $DOTFILESINHOME" | bc -l) +PERC=$(echo "scale=2; $SAVEDDOTFILES / $TOTALDOTFILES" | bc -l) +echo "Coverage is (roughly) around ${PERC}%" +