Skip to content

Commit d587988

Browse files
committed
Update clean command.
Signed-off-by: Chen Su <[email protected]>
1 parent 7559b5e commit d587988

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

dvm.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,16 @@ export DVM_VERSION="v0.8.3"
502502
## Command clean ##
503503
###################
504504
{
505+
# Remove version and download caches.
506+
dvm_clean_caches() {
507+
if [ -d "$DVM_DIR/cache" ]
508+
then
509+
rm -rf "$DVM_DIR/cache"
510+
fi
511+
512+
dvm_clean_download_cache
513+
}
514+
505515
# Clean downloading caches in the disk.
506516
dvm_clean_download_cache() {
507517
if [ ! -d "$DVM_DIR/download" ]
@@ -532,11 +542,6 @@ export DVM_VERSION="v0.8.3"
532542
rmdir "$cache_path"
533543
done
534544
}
535-
536-
if [ -d "$DVM_DIR/cache" ]
537-
then
538-
rm -rf "$DVM_DIR/cache"
539-
fi
540545
}
541546

542547
#####################
@@ -1633,7 +1638,7 @@ export DVM_VERSION="v0.8.3"
16331638
unset -f dvm
16341639
# unset dvm functions
16351640
unset -f dvm_build_deno dvm_check_alias_dir dvm_check_build_dependencies \
1636-
dvm_check_local_deno_clone dvm_clean_download_cache \
1641+
dvm_check_local_deno_clone dvm_clean_caches dvm_clean_download_cache \
16371642
dvm_clone_deno_source dvm_compare_version dvm_confirm_with_prompt \
16381643
dvm_copy_build_target_to_versions_dir dvm_deactivate dvm_debug \
16391644
dvm_download_deno dvm_download_file dvm_extract_file dvm_failure \
@@ -1932,8 +1937,7 @@ dvm() {
19321937

19331938
;;
19341939
"clean")
1935-
# remove all download packages.
1936-
dvm_clean_download_cache
1940+
dvm_clean_caches
19371941

19381942
;;
19391943
"current")

0 commit comments

Comments
 (0)