Skip to content

Instantly share code, notes, and snippets.

@spadin spadin/no_spec_finder.sh
Last active Aug 29, 2015

Embed
What would you like to do?
Find app files without specs
#! /usr/bin/env sh
app_dir=$1
spec_dir=$2
extension=$3
for file in $(find $app_dir -name "*${extension}" -print | sed "s!$app_dir*!!" | sed "s!$extension!!"); do
spec_file="${spec_dir}${file}_spec${extension}"
if [ ! -f $spec_file ]; then
echo $spec_file
fi
done
# Usage: ./no_spec_finder ./app ./spec .rb
#! /usr/bin/env zsh
app_dir=$1
spec_dir=$2
extension=$3
for file in $(find $app_dir -name "*${extension}" -print); do
spec_file="${${file/app/spec}/$extension/_spec$extension}"
if [ ! -f $spec_file ]; then
echo $spec_file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.