Skip to content

Commit 743d199

Browse files
committed
Fetch dvm git data with --all options
Signed-off-by: ghosind <[email protected]>
1 parent 35fbb1c commit 743d199

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

dvm.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,13 +1974,15 @@ export DVM_VERSION="v0.10.0"
19741974
fi
19751975

19761976
# reset changes if exists
1977-
git reset --hard HEAD
1978-
git fetch
1979-
git checkout "$DVM_LATEST_VERSION"
1980-
1981-
dvm_print "DVM has upgrade to latest version, please restart your terminal or run \`source $DVM_PROFILE_FILE\` to apply changes."
1977+
if git reset --hard HEAD && git fetch --all && git pull origin master --tag && git checkout "$DVM_LATEST_VERSION"
1978+
then
1979+
dvm_print "DVM has upgrade to latest version, please restart your terminal or run \`source $DVM_PROFILE_FILE\` to apply changes."
19821980

1983-
cd "$cwd" || dvm_failure
1981+
cd "$cwd" || dvm_failure
1982+
else
1983+
dvm_print_error "failed to update dvm."
1984+
cd "$cwd" && dvm_failure
1985+
fi
19841986
}
19851987
}
19861988

0 commit comments

Comments
 (0)