-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathd.sh
28 lines (28 loc) · 886 Bytes
/
d.sh
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
#! /bin/bash --
#
# download.sh: downloader for StaticPython which autodetects the OS
# by [email protected] at Mon May 23 16:06:56 CEST 2011
#
# Example usage:
#
# curl http://pts-mini-gpl.googlecode.com/svn/trunk/staticpython/d.sh |
# bash /dev/stdin python2.7-static
#
if test $# != 1 || test "${1/\//}" != "$1"; then
echo "Usage: $0: {python2.7-static|stackless2.7-static|stacklessco2.7-static}" >&2
exit 1
fi
if test "`uname`" = Darwin; then
URL="https://raw.githubusercontent.com/pts/staticpython/master/release.darwin/$1"
else
URL="https://raw.githubusercontent.com/pts/staticpython/master/release/$1"
fi
echo "info: downloading: $URL"
if type -p curl >/dev/null 2>&1; then
curl -o "$1.download" "$URL" || exit 2
else
wget -O "$1.download" "$URL" || exit 2
fi
chmod +x "$1.download" || exit 2
mv "$1.download" "$1" || exit 2
echo "info: download OK, run with: ./$1"