Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions dvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1974,13 +1974,15 @@ export DVM_VERSION="v0.10.0"
fi

# reset changes if exists
git reset --hard HEAD
git fetch
git checkout "$DVM_LATEST_VERSION"

dvm_print "DVM has upgrade to latest version, please restart your terminal or run \`source $DVM_PROFILE_FILE\` to apply changes."
if git reset --hard HEAD && git fetch --all && git pull origin master --tag && git checkout "$DVM_LATEST_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the fetch --all is necessary

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch --all should be enough for this problem, and I keep pull --tags to double check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The branch to fetch is not in a global variable?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is in the global variable DVM_LATEST_VERSION

then
dvm_print "DVM has upgrade to latest version, please restart your terminal or run \`source $DVM_PROFILE_FILE\` to apply changes."

cd "$cwd" || dvm_failure
cd "$cwd" || dvm_failure
else
dvm_print_error "failed to update dvm."
cd "$cwd" && dvm_failure
fi
}
}

Expand Down