-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·94 lines (83 loc) · 2.22 KB
/
installer.sh
File metadata and controls
executable file
·94 lines (83 loc) · 2.22 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
function log() {
echo ""
echo "${green}$1${reset}"
echo ""
}
function fail() {
echo ""
echo "${red}$1${reset}"
echo ""
exit 1
}
if [[ ! "$OSTYPE" =~ ^darwin ]]; then
fail "This script only supports Mac OS"
fi;
if ! [ -x "$(command -v rustup)" ]; then
log "Installing rust"
curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
fi;
if [[ ! -d optirust ]]; then
log "Cloning optirust in the 'optirust' folder, feel free to move it afterwards"
git clone --depth=1 https://github.com/charignon/optirust
fi
if [[ ! -d pulp ]]; then
log "Cloning the pulp repo in the 'pulp' folder, feel free to move it afterwards"
git clone --depth=1 https://github.com/coin-or/pulp
fi;
# Any step that fails after this should fail the build
set -e
log "Installing optirust, this will take a while, go grab a coffee!"
pushd optirust
cargo build
log "Running the tests, they should pass"
cargo test
log "Creating sample input and config, see file $(pwd)/input and $(pwd)/config"
cat <<EOF > input
- title: title
description: |
this is my very very very
long description for a
very very interesting
meeting
attendees:
- my_address@gmail.com
min_date: 2018-02-05T10:00:00
max_date: 2030-02-20T18:00:00
- title: title2
description: description
attendees:
- my_address@gmail.com
min_date: 2018-02-05T10:00:00
max_date: 2030-02-20T18:00:00
EOF
cat <<EOF > config
small_rooms:
- foo@bar.com
- joe@baz.com
large_rooms:
- bozorg@jam.com
reject_iso_weekday:
- 3 # Wednesday
- 6 # Saturday
- 7 # Sunday
reject_hour_range:
# Lunch
- from:
hours: 12
minutes: 0
seconds: 0
to:
hours: 13
minutes: 0
seconds: 0
ignore_all_day_events: true
ignore_meetings_with_no_response: true
EOF
log "Your optirust installation is at $(pwd)"
log "Please enable the google calendar API, see https://docs.google.com/presentation/d/16VBTYIqoqWAeS0PW6rmPSHqyaZk5cPCo1ABByqvClSg/edit?usp=sharing"
CBC_PATH="$(pwd)/src/pulp/solverdir/cbc/osx/64"
log "And add ${CBC_PATH} to your path, for example by adding the following to your shell config file: 'export PATH=\$PATH:${CBC_PATH}'"