Skip to content

Commit 42f8d29

Browse files
committed
Update code setup script for new virtual environment
1 parent a653a0c commit 42f8d29

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
.code
21
.vagrant
32
reports

scripts/update-code

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
#!/bin/bash
2+
set -eo pipefail
23

3-
set -e
44

5-
6-
mkdir -p .code/{node,ruby}
5+
mkdir -p ~/src/{node,ruby}
76

87
checkout() {
98
local dir="$1"
109
local repo="$2"
11-
local patch="../../../../patches/$repo.diff"
12-
13-
if [[ -d "$dir" ]] ; then
14-
cd "$dir"
15-
git clean -fd
16-
git fetch origin
17-
git reset --hard @{u}
18-
else
19-
git clone "git://github.com/faye/$repo.git" "$dir"
20-
cd "$dir"
21-
fi
22-
if [[ -f "$patch" ]] ; then
23-
git apply "$patch"
24-
fi
10+
local patch="/vagrant/patches/$repo.diff"
11+
12+
[[ -d "$dir" ]] || git clone "git://github.com/faye/$repo.git" "$dir"
13+
14+
cd "$dir"
15+
git clean -fd
16+
git fetch origin
17+
git reset --hard @{u}
18+
19+
[[ -f "$patch" ]] && git apply "$patch"
20+
2521
cd -
2622
}
2723

2824

29-
cd .code/node
25+
cd ~/src/node
3026

3127
install-node-modules() {
3228
local dir="$1"
@@ -70,21 +66,22 @@ link-repo websocket-extensions extensions
7066
cd -
7167

7268

73-
cd ../ruby
74-
. /usr/local/share/chruby/chruby.sh
69+
cd ~/src/ruby
70+
source /usr/local/share/chruby/chruby.sh
7571

7672
RUBY_VERSIONS=(
7773
ruby-1.9
7874
ruby-2.{0..7}
79-
jruby-{1.7,9.1,9.2}
75+
ruby-3.0
76+
jruby-{1.7,9.2}
8077
)
8178

8279
install-ruby-gems() {
8380
local dir="$1"
8481

8582
cd "$dir"
8683
rm -f Gemfile.lock
87-
ruby -S bundle install --path ../../.bundle
84+
ruby -S bundle install
8885
cd -
8986
}
9087

0 commit comments

Comments
 (0)