This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
FILE_TO_EXTRACT="$1" | |
FILENAME="$(basename $FILE_TO_EXTRACT)" | |
OUTPUT_DIR=$2 | |
[[ ! -d "$OUTPUT_DIR" ]] && mkdir -p "$OUTPUT_DIR" | |
# List other names this file was known as (in case we want to extract those too) | |
for FILE_NAME in `git log --follow --name-only --format= -- ${FILE_TO_EXTRACT} | uniq` | |
do |