b.liu | 575a0f1 | 2024-12-19 20:08:45 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | current_branch=`cat ../scripts/current_branch` |
| 4 | brance_right=0 |
| 5 | |
| 6 | function help() |
| 7 | { |
| 8 | echo "可用分支:" |
| 9 | for brance in $current_branch; |
| 10 | do |
| 11 | echo $brance |
| 12 | done |
| 13 | } |
| 14 | |
| 15 | function brance_check() |
| 16 | { |
| 17 | for brance in $current_branch; |
| 18 | do |
| 19 | if [ "$brance" == "$1" ];then |
| 20 | brance_right=1 |
| 21 | fi |
| 22 | done |
| 23 | } |
| 24 | |
| 25 | |
| 26 | cd .. |
| 27 | MBTK_SOURCE_DIR="mbtk_source" |
| 28 | ASR_RLS_BRANCH=`git branch | grep "*" | cut -d " " -f 2` |
| 29 | cd $MBTK_SOURCE_DIR |
| 30 | |
| 31 | if [ -n "$1" ] ;then |
| 32 | brance_check $1 |
| 33 | if [ $brance_right -eq 1 ]; then |
| 34 | #if [ ! $1 in $current_branch ];then |
| 35 | echo "Brance : $1" |
| 36 | ASR_CUSTOM_BRANCH=$1 |
| 37 | else |
| 38 | help |
| 39 | exit 1 |
| 40 | fi |
| 41 | else |
| 42 | help |
| 43 | exit 1 |
| 44 | fi |
| 45 | |
| 46 | CONFIG_FILE_NAME=config-$ASR_RLS_BRANCH-$ASR_CUSTOM_BRANCH |
b.liu | 61ad917 | 2025-01-09 14:33:55 +0800 | [diff] [blame] | 47 | |
| 48 | if [ ! -f configs/$CONFIG_FILE_NAME ];then |
| 49 | echo "No found config file : $CONFIG_FILE_NAME , use default config file." |
| 50 | CONFIG_FILE_NAME=config-default |
| 51 | fi |
| 52 | |
b.liu | 575a0f1 | 2024-12-19 20:08:45 +0800 | [diff] [blame] | 53 | if [ -f configs/$CONFIG_FILE_NAME ];then |
| 54 | cp -f configs/$CONFIG_FILE_NAME config |
| 55 | ./build.sh clean |
| 56 | echo "Use config file : $CONFIG_FILE_NAME" |
| 57 | cat config | grep = |
| 58 | else |
| 59 | echo "No found config file : $CONFIG_FILE_NAME" |
| 60 | fi |
| 61 | |