-
Notifications
You must be signed in to change notification settings - Fork 0
/
eclipse-mac
46 lines (33 loc) · 1.12 KB
/
eclipse-mac
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
#!/bin/bash
ECLIPSE_LOC=~/bin/eclipse/
export SLOBER_LOC=$ECLIPSE_LOC
ZIP=Eclipse-Macos.zip
USERINZIP=kharrington
if [[ $(uname -m) == 'arm64' ]]; then
echo "M1 Mac detected "
ZIP=Eclipse-mac-AArch64.zip
fi
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if (! test -e ~/bin) then
mkdir ~/bin
fi
if ! [ "$SCRIPT" = "$HOME/bin" ]; then
echo "Script source copied to ~/bin from " $SCRIPT
cp $SCRIPT/eclipse-mac ~/bin/eclipse-mac
chmod +x ~/bin/eclipse-mac
fi
if (! test -e $ECLIPSE_LOC) then
echo "Downloading Eclipse Zip..."
if (! test -e ~/bin/$ZIP ) then
curl -L https://github.com/CommonWealthRobotics/ESP32ArduinoEclipseInstaller/releases/download/0.0.0/$ZIP -o ~/bin/$ZIP
fi
echo "$ECLIPSE_LOC not found, unzipping Eclipse... "
unzip -qq ~/bin/$ZIP -d $SLOBER_LOC
echo "unzipping Eclipse... Complete! "
fi
cd $SLOBER_LOC; grep -RiIl "$USERINZIP" .| xargs sed -i '' -e "s/$USERINZIP/$USER/g"
echo "Parameters are $@"
#Run SLoeber
open $SLOBER_LOC/Eclipse.app --args "$@"
#$SLOBER_LOC/Eclipse.app/Contents/MacOS/eclipse "$@"
#open $SLOBER_LOC/Eclipse.app --args -import {"$@"}