Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a680f36

Browse files
authoredOct 17, 2017
Source init-tools.sh rather than executing it (#240)
* Fix init-tools.sh to work with -euo pipefail * Use "source" rather than "." for readability
1 parent 7115f94 commit a680f36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
1515
export DOTNET_MULTILEVEL_LOOKUP=0
1616
export NUGET_PACKAGES="$SCRIPT_ROOT/packages/"
1717

18-
"$SCRIPT_ROOT/init-tools.sh"
18+
source "$SCRIPT_ROOT/init-tools.sh"
1919

2020
CLIPATH="$SCRIPT_ROOT/Tools/dotnetcli"
2121
SDKPATH="$CLIPATH/sdk/$SDK_VERSION"

‎init-tools.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ __PACKAGES_DIR=$__scriptpath/packages
66
__TOOLRUNTIME_DIR=$__scriptpath/Tools
77
__DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli
88
__DOTNET_CMD=$__DOTNET_PATH/dotnet
9-
if [ -z "$__BUILDTOOLS_SOURCE" ]; then __BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; fi
9+
if [ -z "${__BUILDTOOLS_SOURCE:-}" ]; then __BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; fi
1010
export __BUILDTOOLS_USE_CSPROJ=true
1111
__BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/BuildToolsVersion.txt)
1212
__DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt)
@@ -21,7 +21,7 @@ fi
2121

2222
if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
2323

24-
if [ -d "$DotNetBuildToolsDir" ]; then
24+
if [ -d "${DotNetBuildToolsDir:-}" ]; then
2525
echo "Using tools from '$DotNetBuildToolsDir'."
2626
ln -s "$DotNetBuildToolsDir" "$__TOOLRUNTIME_DIR"
2727

@@ -38,7 +38,7 @@ fi
3838
echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log
3939

4040
if [ ! -e $__DOTNET_PATH ]; then
41-
if [ -z "$__DOTNET_PKG" ]; then
41+
if [ -z "${__DOTNET_PKG:-}" ]; then
4242
if [ "$(uname -m | grep "i[3456]86")" = "i686" ]; then
4343
echo "Warning: build not supported on 32 bit Unix"
4444
fi

0 commit comments

Comments
 (0)
Please sign in to comment.