Skip to content

Commit c00fb83

Browse files
authored
Make scripts fail fast (#82)
In this commit we are using `set -e` to make our bash scripts for building the distro and setting up contract tests fail fast in the case of errors. Without this change, scripts can fail one command, then run the next, obscuring failures and wasting developer time. Also, fix `mkdir` to succeed even if the dir already exists with `-p` and add copyright notices. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent c5c4f7b commit c00fb83

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

scripts/build_and_install_distro.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Fail fast
6+
set -e
7+
28
# Check script is running in contract-tests
39
current_path=`pwd`
410
current_dir="${current_path##*/}"
@@ -9,7 +15,7 @@ fi
915

1016
# Setup - update dependencies and create/empty dist dir
1117
pip install --upgrade pip setuptools wheel packaging build
12-
mkdir dist
18+
mkdir -p dist
1319
rm -rf dist/aws_opentelemetry_distro*
1420

1521
# Build distro

scripts/set-up-contract-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Fail fast
6+
set -e
7+
28
# Check script is running in contract-tests
39
current_path=`pwd`
410
current_dir="${current_path##*/}"

0 commit comments

Comments
 (0)