1#!/usr/bin/env bash 2 3for path in $paths; do 4 if ! [ -e "$src/$path" ]; then 5 echo "Error: $path does not exist" 6 exit 1 7 fi 8 mkdir -p $out/$(dirname $path) 9 if [[ -d $src/$path ]]; then 10 ln -s $src/$path $out/$path 11 else 12 cp -RL $src/$path $out/$path 13 fi 14done