Skip to content
This repository was archived by the owner on Apr 26, 2022. It is now read-only.

Commit 993a200

Browse files
committed
add comments
1 parent f359d56 commit 993a200

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pwsh.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ while getopts "r:l:vh-" opt; do
6767
done
6868
shift $((OPTIND-1))
6969

70+
# TODO: We need to reason better around the wget installation code. When root,
71+
# we are able to install the relevant packages, so we should kickstat
72+
# installation of curl/wget if none can be found.
73+
74+
7075
_logline() {
7176
printf '[%s] [%s] %s\n' "$(basename "$0")" "${2:-NFO}" "$1" >&2
7277
}
@@ -108,12 +113,13 @@ _rpm() {
108113
rpm --import "${PWSH_ROOT%/}/keys/microsoft.asc"
109114
_verbose "Register YUM repository"
110115
_download "$1" > "${PWSH_YUMROOT%/}/microsoft.repo"
111-
# dnf check-update || true
116+
dnf check-update || true
112117
_verbose "Install dependencies and powershell"
113118
yum install -y compat-openssl10
114119
yum install -y powershell
115120
}
116121

122+
# Guess latest stable release version of powershell made at GitHub.
117123
_version() {
118124
if [ -z "$PWSH_VERSION" ]; then
119125
PWSH_VERSION=$( _download "${PWSH_GHAPI%/}/releases" |
@@ -124,13 +130,16 @@ _version() {
124130
fi
125131
}
126132

133+
# Install from YUM package pointed at URL passed as an argument
127134
_yum() {
128135
_verbose "Trying optional dependencies"
129136
yum install -y compat-openssl10 || true
130137
_verbose "Installing package from: $1"
131138
yum install -y "$1"
132139
}
133140

141+
# Install from DEB package pointed at URL passed as an argument. This will
142+
# ensure that there is a wget to download stuff.
134143
_deb() {
135144
# shellcheck disable=SC3043 # local implemented almost everywhere
136145
local _rm || true
@@ -191,6 +200,8 @@ install_asroot() {
191200
esac
192201
}
193202

203+
# Guess machine architecture in a way that is compatible with the PowerShell
204+
# release URLs at GitHub.
194205
_arch() {
195206
case "$(uname -m)" in
196207
x86_64) echo "x64";;

0 commit comments

Comments
 (0)