Skip to content

Commit ba3e2b1

Browse files
committed
install from source: clean up comments
Update comments in the install from source script so that: 1. Sentences begin with capital letters. 2. Sentences end with punctuation. 3. Comments are within 80 characters per line.
1 parent e3a0f0d commit ba3e2b1

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/linux/Packaging.Linux/install-from-source.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
#!/bin/sh
22

3-
# halt execution immediately on failure
4-
# note there are some scenarios in which this will not exit;
5-
# see https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
6-
# for additional details
3+
# Halt execution immediately on failure.
4+
# Note there are some scenarios in which this will not exit; see
5+
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
6+
# for additional details.
77
set -e
88

99
is_ci=
1010
for i in "$@"; do
1111
case "$i" in
1212
-y)
1313
is_ci=true
14-
shift # past argument=value
14+
shift # Past argument=value
1515
;;
1616
esac
1717
done
1818

19-
# in non-ci scenarios, advertise what we will be doing and
20-
# give user the option to exit
19+
# In non-ci scenarios, advertise what we will be doing and
20+
# give user the option to exit.
2121
if [ -z $is_ci ]; then
2222
echo "This script will download, compile, and install Git Credential Manager to:
2323
@@ -47,7 +47,7 @@ install_shared_packages() {
4747

4848
local shared_packages="git curl"
4949
for package in $shared_packages; do
50-
# ensure we don't stomp on existing installations
50+
# Ensure we don't stomp on existing installations.
5151
if [ ! -z $(which $package) ]; then
5252
continue
5353
fi
@@ -66,19 +66,19 @@ ensure_dotnet_installed() {
6666
chmod +x ./dotnet-install.sh
6767
bash -c "./dotnet-install.sh"
6868

69-
# since we have to run the dotnet install script with bash, dotnet isn't added
70-
# to the process PATH, so we manually add it here
69+
# Since we have to run the dotnet install script with bash, dotnet isn't
70+
# added to the process PATH, so we manually add it here.
7171
cd ~
7272
export DOTNET_ROOT=$(pwd)/.dotnet
7373
add_to_PATH $DOTNET_ROOT
7474
fi
7575
}
7676

7777
verify_existing_dotnet_installation() {
78-
# get initial pieces of installed sdk version(s)
78+
# Get initial pieces of installed sdk version(s).
7979
sdks=$(dotnet --list-sdks | cut -c 1-3)
8080

81-
# if we have a supported version installed, return
81+
# If we have a supported version installed, return.
8282
supported_dotnet_versions="6.0"
8383
for v in $supported_dotnet_versions; do
8484
if [ $(echo $sdks | grep "$v") ]; then
@@ -90,7 +90,7 @@ verify_existing_dotnet_installation() {
9090
add_to_PATH () {
9191
for directory; do
9292
if [ ! -d "$directory" ]; then
93-
continue; # skip nonexistent directory
93+
continue; # Skip nonexistent directory.
9494
fi
9595
case ":$PATH:" in
9696
*":$directory:"*)
@@ -112,8 +112,8 @@ apt_install() {
112112

113113
sudo_cmd=
114114

115-
# if the user isn't root, we need to use `sudo` for certain commands
116-
# (e.g. installing packages)
115+
# If the user isn't root, we need to use `sudo` for certain commands
116+
# (e.g. installing packages).
117117
if [ -z "$sudo_cmd" ]; then
118118
if [ `id -u` != 0 ]; then
119119
sudo_cmd=sudo
@@ -127,7 +127,7 @@ case "$distribution" in
127127
$sudo_cmd apt update
128128
install_shared_packages apt install
129129

130-
# install dotnet packages and dependencies if needed
130+
# Install dotnet packages and dependencies if needed.
131131
if [ -z "$(verify_existing_dotnet_installation)" ]; then
132132
# First try to use native feeds (Ubuntu 22.04 and later).
133133
if ! apt_install dotnet6; then
@@ -154,15 +154,15 @@ case "$distribution" in
154154
$sudo_cmd apt update
155155
install_shared_packages apt install
156156

157-
# install dotnet packages and dependencies
157+
# Install dotnet packages and dependencies.
158158
$sudo_cmd apt install libc6 libgcc1 libgssapi-krb5-2 libssl1.1 libstdc++6 zlib1g libicu66 -y
159159
ensure_dotnet_installed
160160
;;
161161
fedora | centos | rhel)
162162
$sudo_cmd dnf update -y
163163
install_shared_packages dnf install
164164

165-
# install dotnet/gcm dependencies
165+
# Install dotnet/GCM dependencies.
166166
$sudo_cmd dnf install krb5-libs libicu openssl-libs zlib findutils which bash -y
167167

168168
ensure_dotnet_installed
@@ -171,7 +171,7 @@ case "$distribution" in
171171
$sudo_cmd apk update
172172
install_shared_packages apk add
173173

174-
# install dotnet/gcm dependencies
174+
# Install dotnet/GCM dependencies.
175175
$sudo_cmd apk add icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib which bash coreutils gcompat
176176

177177
ensure_dotnet_installed
@@ -182,7 +182,7 @@ case "$distribution" in
182182
;;
183183
esac
184184

185-
# detect if the script is part of a full source checkout or standalone instead
185+
# Detect if the script is part of a full source checkout or standalone instead.
186186
script_path="$(cd "$(dirname "$0")" && pwd)"
187187
toplevel_path="${script_path%/src/linux/Packaging.Linux}"
188188
if [ "z$script_path" = "z$toplevel_path" ] || [ ! -f "$toplevel_path/Git-Credential-Manager.sln" ]; then

0 commit comments

Comments
 (0)