#!/bin/bash
#


backup()
{
    
    src_dir="$1/$2/bin/Debug"
	dest_dir="restore/$2"
    files=$3
    echo "------------------------------------"
    echo "backup ${src_dir}"
    echo "to ${dest_dir}"
    if [ ! -d $dest_dir ]; then
        mkdir -p $dest_dir
    fi
    
    for f in ${files[*]}; do
		file_path=$src_dir"/"$f
		cp -rf $file_path $dest_dir
		if [ $? != 0 ]; then
			echo 复制失败
			exit 1
		fi
	done


    #cp -Rf $src_dir/* $dest_dir
}


if [ -d restore ]; then
    rm -Rf restore
fi

project_dir="../Project.FLY.Thick.Blowing"
project_name="FLY.Thick.Blowing.UI.Fix.Client"
files=(\
	"unity" "layout" "music" "default"\
	"版本说明.txt" "测厚仪说明书.pdf" \
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.Thick.Blowing"
project_name="FLY.Thick.Blowing.UI.Fix.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.FeedbackRenZiJia"
project_name="FLY.FeedbackRenZiJia.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.Weight"
project_name="FLY.Weight.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.IBC"
project_name="FLY.IBC.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.Winder_20190413"
project_name="FLY.Winder.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.Weight2"
project_name="FLY.Weight2.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files


project_dir="../Project.FLY.Thick.BlowingScan"
project_name="FLY.Thick.BlowingScan.UI.Client"
files=(\
	"unity" "layout" "music" "default"\
	"版本说明.txt" "测厚仪说明书.pdf" \
	)
backup $project_dir $project_name $files

project_dir="../Project.FLY.Thick.BlowingScan"
project_name="FLY.Thick.BlowingScan.UI.Server"
files=(\
	"Gage1"\
	)
backup $project_dir $project_name $files