#!/bin/bash CURRENT_DIR=$(pwd) SDK_OUT_DIR=out USER_OUT_DIR=$CURRENT_DIR/out if [[ $1 == '-h' || ! -n $1 || ! -n $2 ]]; then echo "help" echo "./copyfile []" echo "pac_name:pac file name that need to be copy" echo "pac_version:pac file name version" echo "core_sdk_name:if empty, we make it 'core_sdk'" exit fi if [[ ! -n $3 ]]; then CORE_SDK_NAME=core_sdk else CORE_SDK_NAME=$3 fi #$1 pac_name #$2 pac_version #$3 core_sdk_name SRCFILE=$CURRENT_DIR/../../$CORE_SDK_NAME/$SDK_OUT_DIR/HGS_MS5700_0211_debug/hex/$1.pac DESFILE=$USER_OUT_DIR/$1_V$2.pac if [ ! -f "$SRCFILE" ]; then echo "$SRCFILE not found" exit fi if [ ! -f "$USER_OUT_DIR" ]; then mkdir -p $USER_OUT_DIR fi cp $SRCFILE $DESFILE echo copy done