Repository navigation
Expand file tree
/
Copy pathdownload.sh
More file actions
executable file
·66 lines (54 loc) · 1.64 KB
/
Copy pathdownload.sh
File metadata and controls
executable file
·66 lines (54 loc) · 1.64 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# CLEAN
git clean -f -x
rm -rf pharo-vm
VM_INSTALL_URL="http://get.pharo.org/vm"
IMAGE_URL="https://ci.inria.fr/pharo-contribution/job/Pillar/PHARO=30,VERSION=bleedingEdge,VM=vm/lastSuccessfulBuild/artifact/Pillar.zip"
usage() {
cat <<HELP
Usage: $0 [-h|--help] [vm] [image]
Downloads the latest image and virtual machine (edit the script to set from where). By default, only the image will be downloaded.
image: $IMAGE_URL
VM: $VM_INSTALL_URL
HELP
}
get_vm() {
wget ${CERTCHECK} --output-document - "$VM_INSTALL_URL" | bash
}
get_image() {
local tempzip="$(mktemp imageXXXXX.zip)"
trap "rm '$tempzip'" EXIT
wget ${CERTCHECK} --progress=bar:force --output-document="$tempzip" "$IMAGE_URL"
for f in $(zipinfo -1 "$tempzip"); do
ext="${f##*.}"
if [ "$ext" == image -o "$ext" == changes ]; then
echo "Pharo.$ext"
unzip -qp "$tempzip" "$f" > "Pharo.$ext"
fi
done
}
# stop the script if a single command fails
set -e
# on mac os wget can be quite old and not recognizing --no-check-certificate
CERTCHECK="--no-check-certificate"
wget --help | grep -- "$CERTCHECK" 2>&1 > /dev/null || CERTCHECK=''
if [ $# -eq 0 ]; then
get_image
get_vm
./pharo Pharo.image config "http://smalltalkhub.com/mc/Pier/Pillar/main/" ConfigurationOfPillar --install=bleedingEdge
exit 0
else
while [ $# -gt 0 ]; do
case "$1" in
-h|--help|help)
usage; exit 0;;
v|vm)
get_vm;;
i|img|image)
get_image;;
*) # boom
usage; exit 1;;
esac
shift
done
fi