Skip to content

Commit 79988d7

Browse files
DhruvaG2000szczys
andcommitted
create install script for linux
* assumes install script runs in module dir * Based on https://stackoverflow.com/questions/48344624/echo-prints-n-differently-between-bin-sh-and-bin-bash recommended is to use printf, hence used instead of echo. * Has confirmation qns in beginning This is to make sure the user has satisfied criterion to run the script successfully Co-authored-by: Mike Szczys <[email protected]> Signed-off-by: Dhruva Gole <[email protected]>
1 parent bf7dcdf commit 79988d7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

install.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
set -e;
3+
4+
printf '%s\n' "Before running this script, make sure of the following:"
5+
printf '%s\n' "1. You have zephyr installed properly on your system."
6+
printf '%s\n' "2. Updated west.yml in zephyr and run west update to pull this module in proper location."
7+
printf '%s\n' "If you meet the above criteria, please enter [yY]Yes and if not, then [nN]No."
8+
read answer;
9+
10+
if [ "$answer" != "${answer#[Yy]}" ] ;then
11+
printf '%s\n' "Yes";
12+
else
13+
printf '%s\n' "No";
14+
exit 1;
15+
fi
16+
17+
API_FOLDER=~/.ArduinoCore-API
18+
if [ ! -d "$API_FOLDER" ] ; then
19+
printf '%s\n' "Cloning ArduinoCore API in $API_FOLDER";
20+
git clone [email protected]:arduino/ArduinoCore-API ~/.ArduinoCore-API;
21+
else
22+
printf '%s\n' "API Folder already exists, skipping clone...";
23+
fi
24+
25+
printf '%s\n' "Commenting out WCharacter.h because it fails to build properly";
26+
sed '/WCharacter.h/ s/./\/\/ &/' ~/.ArduinoCore-API/api/ArduinoAPI.h > ~/.ArduinoCore-API/api/tmpArduinoAPI.h ;
27+
mv ~/.ArduinoCore-API/api/tmpArduinoAPI.h ~/.ArduinoCore-API/api/ArduinoAPI.h ;
28+
29+
printf '%s\n' "Linking...";
30+
ln -sf ~/.ArduinoCore-API/api cores/arduino/. ;
31+
32+
printf '%s\n' "Module Successfully setup...";
33+

0 commit comments

Comments
 (0)