Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (15 sloc) 401 Bytes
repository=$1
file=$2
if [[ -z "$repository" || -z "$file" ]]; then
echo "git/cp script requires 2 arguments"
exit 1
fi
name=$3
: ${name:="${file##*/}"}
directory=$repository
directory=${directory##*/}
directory=${directory%.*}
mkdir -p /var/tmp/repositories/
directory=/var/tmp/repositories/${directory}
[ -d "$directory" ] || git clone $repository $directory
cp ${directory}/${file} ./${name}
You can’t perform that action at this time.