nrf5/bluetooth: Updating Bluetooth LE stack download script to allow to be invoked from any parent folder. No need to change directory to bluetooth/ in order to get the correct download target folder position. Using the script location to determine the target folder.

This commit is contained in:
Glenn Ruben Bakke 2017-04-26 19:18:27 +02:00
parent 7bcc61b0c1
commit 976785e1d5
1 changed files with 15 additions and 13 deletions

View File

@ -8,8 +8,8 @@ function download_s110_nrf51_8_0_0
echo "####################################" echo "####################################"
echo "" echo ""
mkdir -p s110_nrf51_8.0.0 mkdir -p $1/s110_nrf51_8.0.0
cd s110_nrf51_8.0.0 cd $1/s110_nrf51_8.0.0
wget https://www.nordicsemi.com/eng/nordic/download_resource/45846/3/78153065/80234 wget https://www.nordicsemi.com/eng/nordic/download_resource/45846/3/78153065/80234
mv 80234 temp.zip mv 80234 temp.zip
unzip -u temp.zip unzip -u temp.zip
@ -25,9 +25,8 @@ function download_s132_nrf52_2_0_1
echo "####################################" echo "####################################"
echo "" echo ""
mkdir -p s132_nrf52_2.0.1 mkdir -p $1/s132_nrf52_2.0.1
cd s132_nrf52_2.0.1 cd $1/s132_nrf52_2.0.1
wget https://www.nordicsemi.com/eng/nordic/download_resource/51479/6/84640562/95151 wget https://www.nordicsemi.com/eng/nordic/download_resource/51479/6/84640562/95151
mv 95151 temp.zip mv 95151 temp.zip
unzip -u temp.zip unzip -u temp.zip
@ -43,8 +42,8 @@ function download_s132_nrf52_3_0_0
echo "####################################" echo "####################################"
echo "" echo ""
mkdir -p s132_nrf52_3.0.0 mkdir -p $1/s132_nrf52_3.0.0
cd s132_nrf52_3.0.0 cd $1/s132_nrf52_3.0.0
wget https://www.nordicsemi.com/eng/nordic/download_resource/56261/6/26298825/108144 wget https://www.nordicsemi.com/eng/nordic/download_resource/56261/6/26298825/108144
mv 108144 temp.zip mv 108144 temp.zip
@ -53,19 +52,22 @@ function download_s132_nrf52_3_0_0
cd - cd -
} }
SCRIPT_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
echo "No Bluetooth LE stack defined, downloading all." echo "No Bluetooth LE stack defined, downloading all."
download_s110_nrf51_8_0_0 download_s110_nrf51_8_0_0 ${SCRIPT_DIR}
download_s132_nrf52_2_0_1 download_s132_nrf52_2_0_1 ${SCRIPT_DIR}
download_s132_nrf52_3_0_0 download_s132_nrf52_3_0_0 ${SCRIPT_DIR}
else else
case $1 in case $1 in
"s110_nrf51" ) "s110_nrf51" )
download_s110_nrf51_8_0_0 ;; download_s110_nrf51_8_0_0 ${SCRIPT_DIR} ;;
"s132_nrf52_2_0_1" ) "s132_nrf52_2_0_1" )
download_s132_nrf52_2_0_1 ;; download_s132_nrf52_2_0_1 ${SCRIPT_DIR} ;;
"s132_nrf52_3_0_0" ) "s132_nrf52_3_0_0" )
download_s132_nrf52_3_0_0 ;; download_s132_nrf52_3_0_0 ${SCRIPT_DIR} ;;
esac esac
fi fi