Skip to content

Commit b460df3

Browse files
authored
Merge pull request #71 from codecrafters-io/andy/password-prompt
Clarify why and which password is needed
2 parents aaf2a38 + 194d4c3 commit b460df3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ ARCH=$(uname -m)
1414

1515
if [ "$PLATFORM" = "Darwin" ]; then
1616
OS=darwin
17+
OS_NAME=macOS
1718
elif [ "${PLATFORM%% *}" = "Linux" ]; then
1819
OS=linux
20+
OS_NAME=Linux
1921
else
2022
echo "This installer is only supported on Linux and MacOS."
2123
exit 1
@@ -78,12 +80,12 @@ tar xzf "$TEMP_FILE" -C "$TEMP_FOLDER" codecrafters
7880
chmod 0755 "$TEMP_FOLDER/codecrafters"
7981

8082
if ! mkdir -p "$INSTALL_DIR" 2>/dev/null; then
81-
echo -e "${MUTED}Note:${NC} You might need to enter your password to install."
83+
echo -e "${MUTED}Note:${NC} You might need to enter your ${OS_NAME} user password to install."
8284
sudo mkdir -p "$INSTALL_DIR"
8385
fi
8486

8587
if ! mv "$TEMP_FOLDER/codecrafters" "$INSTALL_PATH" 2>/dev/null; then
86-
echo -e "${MUTED}Note:${NC} You might need to enter your password to install."
88+
echo -e "${MUTED}Note:${NC} You might need to enter your ${OS_NAME} user password to install."
8789
sudo mv "$TEMP_FOLDER/codecrafters" "$INSTALL_PATH"
8890
fi
8991

0 commit comments

Comments
 (0)