Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/static/stubs/sh-install
blob: 098b3f0fd1dec8a72bf57fa9369a727e37789fcb (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
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
#!/bin/sh
shoes_host="http://shoes.heroku.com"
shoes_url="$shoes_host/pkg/policeman/linux/shoes-novideo"
this_dir=`pwd`

shoes="$(which shoes)"
if [ -x "$this_dir/shoes" ] ; then
  shoes="$this_dir/shoes"
fi
if [ -z "$shoes" ] ; then
  shoes="$HOME/.shoes/shoes.run"
fi

if [ ! -x "$shoes" ] ; then
  echo "Downloading Shoes... "

  # First, try wget.
  wget="wget -q -O -"
  wdl="wget -q"
  shoes_pkg="$($wget "$shoes_url" 2>/dev/null)"

  if [ -z "$shoes_pkg" ] ; then
    # Then, try curl.
    wget="curl -s"
    wdl="curl -s -O"
    shoes_pkg="$($wget "$shoes_url" 2>/dev/null)"

    if [ -z "$shoes_pkg" ] ; then
      # Lastly, try bsd fetch.
      wget="fetch -q -o -"
      wdl="fetch -q"
      shoes_pkg="$($wget "$shoes_url" 2>/dev/null)"

      if [ -z "$shoes_pkg" ] ; then
        echo "sorry, couldn't find wget or curl."
        exit 1;
      fi
    fi
  fi

  #shoes_run="$shoes_host$shoes_pkg"
  shoes_run="$shoes_pkg"
  echo "Fetching $shoes_run..."
  mkdir -p $HOME/.shoes
  eval $wget "$shoes_run" > $shoes
  chmod 755 $shoes
fi

eval $shoes -- "$this_dir/#{SCRIPT}"