spadin
7/28/2014 - 7:31 PM

Find app files without specs

Find app files without specs

#! /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
#! /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