-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·89 lines (79 loc) · 2.12 KB
/
setup.sh
File metadata and controls
executable file
·89 lines (79 loc) · 2.12 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# somewhat experimental setup script
# ... here be dragons
# make conda available to the script
source ~/anaconda3/etc/profile.d/conda.sh
# setup python environment, checking if env
# already exists
if conda info --envs | grep --quiet "arduino "; then
echo "found arduino conda environment"
conda activate arduino
else
echo "arduino environment not found, creating..."
conda create -n arduino python=2.7 pip
echo "environment created, activating"
conda activate arduino
fi
# check if env is correct version
if python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))' | grep --quiet "2.7"; then
echo "confirmed correct python version"
else
echo "not correct python version, check manually :)"
fi
# installing pip packages
pip install -r requirements.txt
# setup udev
while true; do
read -p "Do you wish to change udev rules to work with pio?" yn
case $yn in
[Yy]* )
echo "ok doing it"
# not really sure if needed
#wget https://raw.githubusercontent.com/platformio/platformio-core/develop/scripts/99-platformio-udev.rules
#sudo cp 99-platformio-udev.rules /etc/udev/rules.d/99-platformio-udev.rules
#sudo service udev restart
break
;;
[Nn]* )
echo "ok, skipping"
break
;;
* ) echo "Please answer yes or no.";;
esac
done
# init platformio core
platformio init
# setup uno
while true; do
read -p "Do you wish to setup pio for use with arduino?" yn
case $yn in
[Yy]* )
echo "ok doing it"
platformio init --board uno
break
;;
[Nn]* )
echo "ok, skipping"
break
;;
* ) echo "Please answer yes or no.";;
esac
done
# setup emacs editor
while true; do
read -p "Do you wish to setup pio for use with emacs?" yn
case $yn in
[Yy]* )
echo "ok doing it"
platformio init --board uno --ide emacs
sh ./ccls-reg.sh
break
;;
[Nn]* )
echo "ok, skipping"
break
;;
* ) echo "Please answer yes or no.";;
esac
done
echo "all done!, look at the run script to handle run operations"