File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111function set_mtb_tools_path {
1212 mtb_path=$1
13- if [ " $mtb_path " = " " ]; then
13+ if [ -z " $mtb_path " ]; then
1414 mtb_path=~ /ModusToolbox
1515 fi
1616
1717 echo ${mtb_path} /tools_*
1818}
1919
2020function export_path {
21- mtb_tools_path=$( set_mtb_tools_path)
21+ mtb_tools_path=$( set_mtb_tools_path " $1 " )
2222 export PATH=${mtb_tools_path} /openocd/bin:${mtb_tools_path} /library-manager:${mtb_tools_path} /fw-loader/bin/:${mtb_tools_path} /gcc/bin:$PATH
2323}
2424
2525function install_udev_rules {
26- mtb_tools_path=$( set_mtb_tools_path)
27- ${mtb_tools_path} /openocd/udev_rules/install_rules.sh
26+ mtb_tools_path=$( set_mtb_tools_path " $1 " )
27+ test -f ${mtb_tools_path} /openocd/udev_rules/install_rules.sh && ${mtb_tools_path} /openocd/udev_rules/install_rules.sh
2828}
2929
3030function toolchain_setup {
3131 mtb_path=$1
3232 export_path ${mtb_path}
33- install_udev_rules
33+ install_udev_rules ${mtb_path}
3434}
3535
3636function git_add_ssh {
3737 ssh_key=$1
3838 eval $( ssh-agent -s)
3939 ssh-add ${ssh_key}
40- }
40+ }
You can’t perform that action at this time.
0 commit comments