#!/usr/bin/env bash
###################################################################
#
#	File    : filecontains
#	Author  : adb <adb>
#	Created : 24-03-04
#
###################################################################
#
if [ "$1" == "" ]; then exit 0 ;fi

RESULTS=$(grep -r "$1" 2>/dev/null | fzf --prompt "Edit File : ")


if [ -z "$RESULTS" ]; then exit 0 ; fi

RESULT=$(echo "$RESULTS" | awk -F: '{print $1}')

$EDITOR $RESULT
