diff --git a/cmd/tools/vwipe-cache.v b/cmd/tools/vwipe-cache.v new file mode 100644 index 0000000000..a72be1c845 --- /dev/null +++ b/cmd/tools/vwipe-cache.v @@ -0,0 +1,13 @@ +module main + +import os +import v.vcache + +fn main() { + mut cm := vcache.new_cache_manager([]) + cpath := cm.basepath + if os.exists(cpath) && os.is_dir(cpath) { + os.rmdir_all(cpath) + } + println('V cache folder $cpath was wiped.') +} diff --git a/cmd/v/v.v b/cmd/v/v.v index 634d0a5307..56f22409aa 100644 --- a/cmd/v/v.v +++ b/cmd/v/v.v @@ -30,6 +30,7 @@ const ( 'build-examples', 'build-vbinaries', 'setup-freetype', + 'wipe-cache', 'doc', 'doctor', ]