Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch unexpected errors in Bourne shell scripts. #168

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci/linux-cxx-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# LLVM_VER: The LLVM toolset version to point the repo at.
# PACKAGES: Compiler packages to install.

set -e
set -u

if command -v sudo ; then
SUDO="sudo -E"
fi
Expand Down
6 changes: 4 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

set -e
set -u

# Build b2
echo "Building the B2 engine.."
pwd=`pwd`
"${pwd}/src/engine/build.sh" "$@"
if [ $? -ne 0 ]; then
if ! "${pwd}/src/engine/build.sh" "$@" ; then
echo
echo "Failed to build the B2 engine." 1>&2
exit 1
Expand Down
11 changes: 4 additions & 7 deletions src/engine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#~ (See accompanying file LICENSE_1_0.txt or copy at
#~ http://www.boost.org/LICENSE_1_0.txt)

set -e
set -u

FALSE=1
TRUE=0

Expand All @@ -22,13 +25,7 @@ B2_CXXFLAGS_OPT=

# We need to calculate and set SCRIPT_PATH and SCRIPT_DIR to reference this
# script so that we can refer to file relative to it.
SCRIPT_PATH=""
if test "${BASH_SOURCE}" ; then
SCRIPT_PATH=${BASH_SOURCE}
fi
if test "${SCRIPT_PATH}" = "" ; then
SCRIPT_PATH=$0
fi
SCRIPT_PATH=$0
SCRIPT_DIR="$( cd "$( dirname "${SCRIPT_PATH}" )" && pwd )"

# This script needs to operate at engine source directory.
Expand Down
Loading