#!/bin/bash

for f in `find ../client -type f -name '*.js'`;
do
  echo 'FILE:'$f;
  grep -E '\/\/ *datacheck:' $f;
done | gawk '{
  if ( /FILE:/ ) {
    split( $0, parts, ":" )
    file = parts[2]
  }
  if ( /datacheck:/ ) {
    path = $0
    sub( /^ *\/\/ *datacheck/, "", path )
    print file""path
  }
}' | sed 's/^\.\.\///' | sort -t \: -k 2
