copyfile 768 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. CURRENT_DIR=$(pwd)
  3. SDK_OUT_DIR=out
  4. USER_OUT_DIR=$CURRENT_DIR/out
  5. if [[ $1 == '-h' || ! -n $1 || ! -n $2 ]]; then
  6. echo "help"
  7. echo "./copyfile <pac_name> <pac_version> [<core_sdk_name>]"
  8. echo "pac_name:pac file name that need to be copy"
  9. echo "pac_version:pac file name version"
  10. echo "core_sdk_name:if empty, we make it 'core_sdk'"
  11. exit
  12. fi
  13. if [[ ! -n $3 ]]; then
  14. CORE_SDK_NAME=core_sdk
  15. else
  16. CORE_SDK_NAME=$3
  17. fi
  18. #$1 pac_name
  19. #$2 pac_version
  20. #$3 core_sdk_name
  21. SRCFILE=$CURRENT_DIR/../../$CORE_SDK_NAME/$SDK_OUT_DIR/HGS_MS5700_0211_debug/hex/$1.pac
  22. DESFILE=$USER_OUT_DIR/$1_V$2.pac
  23. if [ ! -f "$SRCFILE" ]; then
  24. echo "$SRCFILE not found"
  25. exit
  26. fi
  27. if [ ! -f "$USER_OUT_DIR" ]; then
  28. mkdir -p $USER_OUT_DIR
  29. fi
  30. cp $SRCFILE $DESFILE
  31. echo copy done