Skip to content

Commit 7772bfe

Browse files
author
Elliot Boschwitz
authored
Changed switch statement to convert string to lowercase (#430)
1 parent d5c24a2 commit 7772bfe

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

build_scripts/debian/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ local_repo=$1
1212

1313
sudo apt-get update
1414

15-
if [ "${MSSQL_CLI_OFFICIAL_BUILD}" != "True" ]
15+
# the ',,' makes environment variable lower case in Bash 4+
16+
if [ "${MSSQL_CLI_OFFICIAL_BUILD,,}" != "true" ]
1617
then
1718
time_stamp=$(date +%y%m%d%H%M)
1819
CLI_VERSION=$CLI_VERSION.dev$time_stamp

build_scripts/rpm/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ sudo yum install -y gcc git rpm-build rpm-devel rpmlint make bash diffutils patc
1616
rm -rf ~/rpmbuild
1717
rm -rf ${REPO_PATH}/../rpm_output
1818

19+
# the ',,' makes environment variable lower case in Bash 4+
20+
# needed before switch statement checks for 'true'
21+
MSSQL_CLI_OFFICIAL_BUILD="${MSSQL_CLI_OFFICIAL_BUILD,,}"
22+
1923
# Build rpm package
2024
rpmbuild -v -bb --clean ${REPO_PATH}/build_scripts/rpm/mssql-cli.spec
2125

build_scripts/rpm/mssql-cli.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
%define repo_path %{getenv:REPO_PATH}
1919
%define official_build %{getenv:MSSQL_CLI_OFFICIAL_BUILD}
2020

21-
%if "%{official_build}" != "True"
21+
# the ',,' makes environment variable lower case in Bash 4+
22+
%if "%{official_build}" != "true"
2223
%define version %{base_version}.dev%{time_stamp}
2324
%else
2425
%define version %{base_version}

0 commit comments

Comments
 (0)