File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55TRACK=java
66TRACK_REPO=" $TRACK "
77TRACK_SRC_EXT=" java"
8+ CPU_CORES=` getconf NPROCESSORS_ONLN 2> /dev/null || getconf _NPROCESSORS_ONLN 2> /dev/null || echo 1`
89
910on_exit () {
1011 echo " >>> on_exit()"
@@ -98,6 +99,14 @@ get_cpu_architecture() {
9899 esac
99100}
100101
102+ get_optimal_amount_of_jobs () {
103+ if [ " $CPU_CORES " -gt " 1" ]; then
104+ echo $(( CPU_CORES- 1 ))
105+ else
106+ echo 1
107+ fi
108+ }
109+
101110download_exercism_cli () {
102111 local os=" $1 "
103112 local arch=" $2 "
@@ -164,7 +173,7 @@ make_local_trackler() {
164173 cp -r ${track_root} /exercises tracks/${TRACK}
165174
166175 gem install bundler
167- bundle install --jobs $(( `nproc -- all` - 1 ) )
176+ bundle install --jobs $( get_optimal_amount_of_jobs )
168177 gem build trackler.gemspec
169178
170179 # Make *this* the gem that x-api uses when we build x-api.
@@ -181,7 +190,7 @@ start_x_api() {
181190 pushd $xapi_home
182191
183192 gem install bundler
184- bundle install --jobs $(( `nproc -- all` - 1 ))
193+ bundle install --jobs $( get_optimal_amount_of_jobs )
185194 RACK_ENV=development rackup &
186195 xapi_pid=$!
187196 sleep 5
You can’t perform that action at this time.
0 commit comments