1- #/bin/sh
1+ #! /bin/sh
22
33set -e
44set -u
55
66BASEDIR=" ${PWD} "
77
8- TARGET_PLATFORM=x86_64-darwin
9- RUBY_TARGET_PLATFORM=x86_64-darwin
8+ export TARGET_PLATFORM=x86_64-darwin
9+ export RUBY_TARGET_PLATFORM=x86_64-darwin
1010
1111bundle install
1212
13+ # shellcheck disable=SC2034
1314RUBY_PLATFORM=$( ./libexec/metadata ruby_platform)
1415GEM_PLATFORM=$( ./libexec/metadata gem_platform)
1516GEM_VERSION=$( ./libexec/metadata gem_version)
1617NODE_VERSION=$( ./libexec/metadata node_version)
1718LIBV8_VERSION=$( ./libexec/metadata libv8_version)
1819
19- ./libexec/download-node $NODE_VERSION
20- ./libexec/extract-node $NODE_VERSION
20+ ./libexec/download-node " $NODE_VERSION "
21+ ./libexec/extract-node " $NODE_VERSION "
2122
2223# Validate that we have the correct V8 version.
2324libv8_version_h=$( ./libexec/metadata libv8_version_h)
@@ -27,18 +28,16 @@ if [ "$libv8_version_h" != "$LIBV8_VERSION" ]; then
2728fi
2829
2930# Build the package.
30- ./libexec/build-libv8 $NODE_VERSION
31- ./libexec/build-monolith $NODE_VERSION
32- ./libexec/inject-libv8 $NODE_VERSION
31+ ./libexec/build-libv8 " $NODE_VERSION "
32+ ./libexec/build-monolith " $NODE_VERSION "
33+ ./libexec/inject-libv8 " $NODE_VERSION "
3334
3435# Run V8 tests.
3536cd test/gtest
3637cmake -S . -B build
3738cd build
3839cmake --build .
39- ./c_v8_tests
40-
41- if [ $? -ne 0 ]; then
40+ if ! ./c_v8_tests; then
4241 echo " Tests failed."
4342 exit 1
4443fi
@@ -48,12 +47,13 @@ cd "${BASEDIR}"
4847bundle exec rake binary
4948
5049# Test that the gem can be installed and used.
51- gem install pkg/libv8-node-$GEM_VERSION- $GEM_PLATFORM.gem
50+ gem install pkg/libv8-node-" $GEM_VERSION " - " $GEM_PLATFORM " .gem
5251
5352rm -rf test/mini_racer
5453git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1
5554cd test/mini_racer
5655ruby -i -ne " \$ _ =~ /^\s+LIBV8_NODE_VERSION/ ? print(\" LIBV8_NODE_VERSION = \\\" $GEM_VERSION \\\"\\ n\" ) : print" lib/mini_racer/version.rb
56+ # shellcheck disable=SC2016
5757ruby -i -ne ' $_ =~ /spec.required_ruby_version/ ? "" : print' mini_racer.gemspec
5858bundle install
5959bundle exec rake compile
0 commit comments