updated on Wed Jan 11 00:07:16 UTC 2012
[aur-mirror.git] / eagle / eagle.sh
blob52cd2ddc97057d402be98fb9e3ef015bdd471478
1 #!/bin/bash
3 # A personal lbr dir can be set via $1 (defaults to $HOME/eagle/lbr if not set)
6 readonly VER=@VERSION@
7 readonly REL=@RELEASE@
9 LOCAL_DIR="$HOME"/.eagle
10 PROJ_DIR="$HOME"/eagle
11 EAGLE_DIR=/opt/eagle-$VER
13 LOCAL_LBR="${1:-$PROJ_DIR/lbr}"
14 if [[ -n $1 ]] || (! grep "^Directories\.Lbr[^=]*=" "$HOME"/.eaglerc &> /dev/null); then
15 echo "Directories.Lbr = \"$LOCAL_LBR\"" >> "$HOME"/.eaglerc
18 create_local() {
19 rm -rf "$LOCAL_DIR"
20 install -dm755 "$LOCAL_DIR"
21 cp -r "$EAGLE_DIR"/* "$LOCAL_DIR"
22 touch "$LOCAL_DIR"/.eagle-$VER-$REL
25 [[ ! -e "$LOCAL_DIR"/.eagle-$VER-$REL ]] && create_local
26 [[ ! -d "$LOCAL_LBR" ]] && install -dm755 "$LOCAL_LBR"
27 [[ ! -d "$PROJ_DIR" ]] && install -dm755 "$PROJ_DIR"
29 cd "$LOCAL_DIR"/bin
30 exec ./eagle