The Wayback Machine - https://web.archive.org/web/20220125091017/https://github.com/arduino/arduino-cli/pull/1603/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install script's check for previous installation #1603

Merged
merged 1 commit into from Dec 20, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -186,19 +186,19 @@ bye() {

testVersion() {
set +e
EXECUTABLE_PATH="$(command -v $PROJECT_NAME)"
if [ "$?" = "1" ]; then
# $PATH is intentionally a literal in this message.
# shellcheck disable=SC2016
echo "$PROJECT_NAME not found. You might want to add \"$EFFECTIVE_BINDIR\" to your "'$PATH'
else
if EXECUTABLE_PATH="$(command -v $PROJECT_NAME)"; then
# Convert to resolved, absolute paths before comparison
EXECUTABLE_REALPATH="$(cd -- "$(dirname -- "$EXECUTABLE_PATH")" && pwd -P)"
EFFECTIVE_BINDIR_REALPATH="$(cd -- "$EFFECTIVE_BINDIR" && pwd -P)"
if [ "$EXECUTABLE_REALPATH" != "$EFFECTIVE_BINDIR_REALPATH" ]; then
# $PATH is intentionally a literal in this message.
# shellcheck disable=SC2016
echo "An existing $PROJECT_NAME was found at $EXECUTABLE_PATH. Please prepend \"$EFFECTIVE_BINDIR\" to your "'$PATH'" or remove the existing one."
fi
else
# $PATH is intentionally a literal in this message.
# shellcheck disable=SC2016
echo "$PROJECT_NAME not found. You might want to add \"$EFFECTIVE_BINDIR\" to your "'$PATH'
fi

set -e