Skip to content

Commit 9b24978

Browse files
committed
Use lowercase for all non env variable vars
1 parent db33329 commit 9b24978

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

Diff for: scripts/build_a_package.sh

+20-20
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,48 @@
2121
set -ev
2222

2323
if [ -z $GITHUB_REF ]; then
24-
echo 'Failed to run script, missing workflow env variable GITHUB_REF'
24+
echo 'Failed to run script, missing workflow env variable GITHUB_REF.'
2525
exit -1
2626
fi
2727

28-
PKG_NAME_AND_VERSION=${GITHUB_REF#refs/tags/*}
29-
PKG_NAME=${PKG_NAME_AND_VERSION%==*}
30-
PKG_VERSION=${PKG_NAME_AND_VERSION#opentelemetry-*==}
28+
pkg_name_and_version=${GITHUB_REF#refs/tags/*}
29+
pkg_name=${pkg_name_and_version%==*}
30+
pkg_version=${pkg_name_and_version#opentelemetry-*==}
3131

3232
# Get the latest versions of packaging tools
3333
python3 -m pip install --upgrade pip setuptools wheel packaging
3434

3535
# Validate vesrion against PEP 440 conventions: https://packaging.pypa.io/en/latest/version.html
36-
python3 -c "from packaging.version import Version; Version('${PKG_VERSION}')"
36+
python3 -c "from packaging.version import Version; Version('${pkg_version}')"
3737

38-
BASEDIR=$(git rev-parse --show-toplevel)
39-
cd $BASEDIR
38+
basedir=$(git rev-parse --show-toplevel)
39+
cd $basedir
4040

41-
DISTDIR=${BASEDIR}/dist
42-
mkdir -p $DISTDIR
43-
rm -rf $DISTDIR/*
41+
distdir=${basedir}/dist
42+
mkdir -p $distdir
43+
rm -rf $distdir/*
4444

45-
SETUP_PY_FILE_PATH=$(ls **/$PKG_NAME/setup.py)
45+
setup_py_file_path=$(ls **/$pkg_name/setup.py)
4646

47-
if [ -z $SETUP_PY_FILE_PATH ]; then
48-
echo "Error! setup.py not found for $PKG_NAME, can't build."
47+
if [ -z $setup_py_file_path ]; then
48+
echo "Error! setup.py not found for $pkg_name, can't build."
4949
exit -1
5050
fi
5151

52-
DIRECTORY_WITH_PACKAGE=$(dirname $SETUP_PY_FILE_PATH)
52+
directory_with_package=$(dirname $setup_py_file_path)
5353

54-
cd $DIRECTORY_WITH_PACKAGE
54+
cd $directory_with_package
5555

56-
python3 setup.py sdist --dist-dir ${DISTDIR} clean --all
56+
python3 setup.py sdist --dist-dir ${distdir} clean --all
5757

58-
cd $DISTDIR
58+
cd $distdir
5959

60-
PKG_TAR_GZ_FILE=${PKG_NAME}-${PKG_VERSION}.tar.gz
60+
pkg_tar_gz_file=${pkg_name}-${pkg_version}.tar.gz
6161

62-
if ! [ -f $PKG_TAR_GZ_FILE ]; then
62+
if ! [ -f $pkg_tar_gz_file ]; then
6363
echo 'Error! Tag version does not match version built using latest package files.'
6464
exit -1
6565
fi
6666

6767
# Build a wheel for the source distribution
68-
pip wheel --no-deps $PKG_TAR_GZ_FILE
68+
pip wheel --no-deps $pkg_tar_gz_file

0 commit comments

Comments
 (0)