aboutsummaryrefslogtreecommitdiff
path: root/install.sh
blob: e168491ad83bd43567920dc899b7d5bc3db48c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
if [[ "$OSTYPE" == "linux-gnu" ]]; then
  HARDWARE=~/Arduino/hardware
elif [[ "$OSTYPE" == "darwin"* ]]; then
  HARDWARE=~/Documents/Arduino/hardware  
else
  echo "OS not supported in install script, manually symlink or copy arcore to your Arduino IDE's hardware folder."
  exit
fi
TARGET=$HARDWARE/arcore
mkdir -p $HARDWARE
if [[ -d "$TARGET" ]]; then
  if [[ -d "$TARGET/avr" ]]; then
    echo "Already installed at $TARGET"
  else
    rm "$TARGET"
    ln -s "$PWD/hardware" "$TARGET"
    echo "Re-installed at $TARGET"
  fi
else
  ln -s "$PWD/hardware" "$TARGET"
  echo "Installed at $TARGET"
fi