Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
- Replace raw echo with output helpers in general/update-dotnet-tools
- Replace raw echo with output helpers in general/stream
- Replace raw echo with output helpers in general/ssh-key-mgr
- Replace raw echo with output helpers in general/install-latest-dotnet
### Changed
- Replace raw echo with standard output helpers (die/info/success) in github/cancel-workflows
- Replace raw echo with standard output helpers (die/info/success) in git/update-repos-personal
Expand Down
47 changes: 29 additions & 18 deletions general/install-latest-dotnet
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
#! /bin/bash

die() {
echo
echo "$@"
if [ -t 2 ]; then
printf '\n\033[31m✗\033[0m %s\n' "$*" >&2
else
printf '\n✗ %s\n' "$*" >&2
fi
exit 1
}

success() {
if [ -t 1 ]; then
printf '\n\033[32m✓\033[0m %s\n' "$*"
else
printf '\n✓ %s\n' "$*"
fi
}

info() {
if [ -t 1 ]; then
printf '\n\033[32m→\033[0m %s\n' "$*"
else
printf '\n→ %s\n' "$*"
fi
}



# args:
Expand Down Expand Up @@ -131,22 +150,19 @@ remove_beginning_slash() {
}

say() {
echo "dotnet-install: $1"
info "dotnet-install: $*"
}

say_verbose() {
if [ "$verbose" = true ]; then
say "$1"
say "$*"
fi
}

say_err() {
say "$1"
exit 1
die "$*"
}

#!/bin/bash

set -e

get_latest_dotnet_sdk_version() {
Expand Down Expand Up @@ -205,11 +221,8 @@ for VERSION in $VERSIONS_TO_INSTALL; do
TEMPORARY_FILE="$(mktemp "$temporary_file_template")"


echo "**********************************************************************************************"
echo "* Installing dotnet: $VERSION"
echo "* Current SDK: $SDK_VERSION"
echo "**********************************************************************************************"
echo ""
info "Installing dotnet $VERSION (SDK: $SDK_VERSION)"

DOWNLOAD_URL=$DOWNLOAD_SOURCE/dotnet/Sdk/$SDK_VERSION/dotnet-sdk-$SDK_VERSION-linux-x64.tar.gz
curl \
--max-time 120 \
Expand All @@ -227,14 +240,12 @@ for VERSION in $VERSIONS_TO_INSTALL; do

/usr/share/dotnet/dotnet --list-sdks

echo ""
done

echo "Install/update powershell"
info "Install/update powershell"
/usr/share/dotnet/dotnet tool update --local PowerShell || dotnet tool install --local PowerShell

echo "Restoring tools"
info "Restoring tools"
/usr/share/dotnet/dotnet tool restore


echo "Done"
success "Done"
Loading