Skip to content

Commit 93cb418

Browse files
committed
fix: Unix install script
1 parent 93ccab0 commit 93cb418

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

install.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ ARCH=""
88
INSTALL_DIR="/usr/local/bin"
99
NO_RELEASE_ASSET=""
1010

11+
# Calculate checksum. We use this function because Linux and macOS have different commands
12+
calculate_checksum() {
13+
if [ "$OS_NAME" = "Darwin" ]; then
14+
# macOS
15+
shasum -a 256 "$1" | cut -d ' ' -f 1
16+
else
17+
# Linux and others
18+
sha256sum "$1" | cut -d ' ' -f 1
19+
fi
20+
}
21+
1122
echo "Installing envfetch to $INSTALL_DIR"
1223
echo "This script will activate sudo to install to $INSTALL_DIR"
1324
sudo echo "Sudo activated"
@@ -63,14 +74,3 @@ fi
6374
sudo chmod +x "$INSTALL_DIR/envfetch"
6475

6576
echo "Successfully installed envfetch"
66-
67-
# Calculate checksum. We use this function because Linux and macOS have different commands
68-
calculate_checksum() {
69-
if [ "$OS_NAME" = "Darwin" ]; then
70-
# macOS
71-
shasum -a 256 "$1" | cut -d ' ' -f 1
72-
else
73-
# Linux and others
74-
sha256sum "$1" | cut -d ' ' -f 1
75-
fi
76-
}

0 commit comments

Comments
 (0)