Make shell scripts work on sh (Bourne shell) (#2360)

This commit is contained in:
Paulo Janotti 2023-03-22 08:39:41 -07:00 committed by GitHub
parent 999a8a163e
commit cec9a1fc28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@ else
# If global.json exists, load expected version # If global.json exists, load expected version
if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then
DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")")
if [[ "$DOTNET_VERSION" == "" ]]; then if [[ "$DOTNET_VERSION" = "" ]]; then
unset DOTNET_VERSION unset DOTNET_VERSION
fi fi
fi fi

View File

@ -59,7 +59,7 @@ if [ -z "$(ls -A $OTEL_DOTNET_AUTO_HOME)" ]; then
return 1 return 1
fi fi
# get absulute path # get absulute path
if [ "$OS_TYPE" == "macos" ]; then if [ "$OS_TYPE" = "macos" ]; then
OTEL_DOTNET_AUTO_HOME=$(greadlink -fn $OTEL_DOTNET_AUTO_HOME) OTEL_DOTNET_AUTO_HOME=$(greadlink -fn $OTEL_DOTNET_AUTO_HOME)
else else
OTEL_DOTNET_AUTO_HOME=$(readlink -fn $OTEL_DOTNET_AUTO_HOME) OTEL_DOTNET_AUTO_HOME=$(readlink -fn $OTEL_DOTNET_AUTO_HOME)
@ -69,7 +69,7 @@ if [ -z "$OTEL_DOTNET_AUTO_HOME" ]; then
return 1 return 1
fi fi
# on Windows change to Windows path format # on Windows change to Windows path format
if [ "$OS_TYPE" == "windows" ]; then if [ "$OS_TYPE" = "windows" ]; then
OTEL_DOTNET_AUTO_HOME=$(cygpath -w $OTEL_DOTNET_AUTO_HOME) OTEL_DOTNET_AUTO_HOME=$(cygpath -w $OTEL_DOTNET_AUTO_HOME)
fi fi
if [ -z "$OTEL_DOTNET_AUTO_HOME" ]; then if [ -z "$OTEL_DOTNET_AUTO_HOME" ]; then
@ -78,7 +78,7 @@ if [ -z "$OTEL_DOTNET_AUTO_HOME" ]; then
fi fi
# set the platform-specific path separator (; on Windows and : on others) # set the platform-specific path separator (; on Windows and : on others)
if [ "$OS_TYPE" == "windows" ]; then if [ "$OS_TYPE" = "windows" ]; then
SEPARATOR=";" SEPARATOR=";"
else else
SEPARATOR=":" SEPARATOR=":"
@ -129,7 +129,7 @@ if [ "$ENABLE_PROFILING" = "true" ]; then
esac esac
# Enable .NET Framework Profiling API # Enable .NET Framework Profiling API
if [ "$OS_TYPE" == "windows" ] if [ "$OS_TYPE" = "windows" ]
then then
export COR_ENABLE_PROFILING="1" export COR_ENABLE_PROFILING="1"
export COR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}" export COR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}"
@ -141,7 +141,7 @@ if [ "$ENABLE_PROFILING" = "true" ]; then
# Enable .NET Core Profiling API # Enable .NET Core Profiling API
export CORECLR_ENABLE_PROFILING="1" export CORECLR_ENABLE_PROFILING="1"
export CORECLR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}" export CORECLR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}"
if [ "$OS_TYPE" == "windows" ] if [ "$OS_TYPE" = "windows" ]
then then
# Set paths for both bitness on Windows, see https://docs.microsoft.com/en-us/dotnet/core/run-time-config/debugging-profiling#profiler-location # Set paths for both bitness on Windows, see https://docs.microsoft.com/en-us/dotnet/core/run-time-config/debugging-profiling#profiler-location
export CORECLR_PROFILER_PATH_64="$OTEL_DOTNET_AUTO_HOME/win-x64/OpenTelemetry.AutoInstrumentation.Native.$SUFIX" export CORECLR_PROFILER_PATH_64="$OTEL_DOTNET_AUTO_HOME/win-x64/OpenTelemetry.AutoInstrumentation.Native.$SUFIX"

View File

@ -24,7 +24,7 @@ if [ -z "$OS_TYPE" ]; then
fi fi
function DownloadClangTool { function DownloadClangTool {
if [ "$OS_TYPE" == "windows" ]; then if [ "$OS_TYPE" = "windows" ]; then
FILENAME=$1.exe FILENAME=$1.exe
else else
FILENAME=$1 FILENAME=$1

View File

@ -24,7 +24,7 @@ if [ -z "$OS_TYPE" ]; then
esac esac
fi fi
if [ "$OS_TYPE" == "windows" ]; then if [ "$OS_TYPE" = "windows" ]; then
EXT=.exe EXT=.exe
else else
EXT= EXT=