forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdev-setup.sh
More file actions
40 lines (33 loc) · 1.04 KB
/
dev-setup.sh
File metadata and controls
40 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Use this script to setup your development environment.
# With the ModusToolbox installed:
#
# $ source dev-setup.sh && toolchain_setup [path_to_modustoolbox]
#
# The path to the ModusToolbox is required if installed somewhere
# else than in the default home path (~/ModusToolbox)
function set_mtb_tools_path {
mtb_path=$1
if [ -z "$mtb_path" ]; then
mtb_path=~/ModusToolbox
fi
echo ${mtb_path}/tools_3.0
}
function export_path {
mtb_tools_path=$(set_mtb_tools_path "$1")
export PATH=${mtb_tools_path}/openocd/bin:${mtb_tools_path}/library-manager:${mtb_tools_path}/fw-loader/bin/:${mtb_tools_path}/gcc/bin:$PATH
}
function install_udev_rules {
mtb_tools_path=$(set_mtb_tools_path "$1")
test -f ${mtb_tools_path}/openocd/udev_rules/install_rules.sh && ${mtb_tools_path}/openocd/udev_rules/install_rules.sh
}
function toolchain_setup {
mtb_path=$1
export_path ${mtb_path}
install_udev_rules ${mtb_path}
}
function git_add_ssh {
ssh_key=$1
eval $(ssh-agent -s)
ssh-add ${ssh_key}
}