vsclean 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +16 -0
- data/lib/commands/command.rb +20 -4
- data/lib/info.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6f98859e63b8203d447fa82be40dec03fadc7c3
|
4
|
+
data.tar.gz: eefafe2e2410e5d899fe25ceefa3b81bd7337dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8eb24505368914e32e9d53b392a83deb9ea07510ae851bbfef65b294d31d6554f9c2f995f0cd1e870c54152c9fae9970d2f76d9cb321d19e6ebbcfb4056ef19
|
7
|
+
data.tar.gz: 9d7d9505f4b02844f2f8a8198c1e81a6bdf9ad3a4188eed32d443fb27ad977615a4ecca649281f7fe82dd3f76105d6c4de30ce0aebf264d3ff6a6d2b8958b12b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -8,9 +8,25 @@ A recursive delete of temporary Visual Studio and ReSharper output files, vsclea
|
|
8
8
|
|
9
9
|
## Usage:
|
10
10
|
|
11
|
+
Note: Use `--dry-run` to simulate deletion first, for more safety.
|
12
|
+
|
11
13
|
### Local Cleanup
|
12
14
|
|
13
15
|
$ vsclean
|
14
16
|
|
15
17
|
- Deletes `**/{bin,obj}`
|
16
18
|
- Deletes `**/.vs/**/.suo`
|
19
|
+
|
20
|
+
### Global Cleanup
|
21
|
+
|
22
|
+
$ vsclean --global
|
23
|
+
|
24
|
+
- Deletes `~/AppData/Local/JetBrains/**/SolutionCaches`
|
25
|
+
- Deletes `~/AppData/Microsoft/WebsiteCache`
|
26
|
+
- Deletes `~//AppData/Local/Microsoft/**/ComponentModelCache`
|
27
|
+
|
28
|
+
### Full Cleanup
|
29
|
+
|
30
|
+
$ vsclean --full
|
31
|
+
|
32
|
+
- Deletes all local and global temporary files and directories
|
data/lib/commands/command.rb
CHANGED
@@ -4,6 +4,12 @@ require "console"
|
|
4
4
|
require "fileutils"
|
5
5
|
|
6
6
|
module VsClean
|
7
|
+
class Mode
|
8
|
+
LOCAL = 0
|
9
|
+
GLOBAL = 1
|
10
|
+
FULL = 2
|
11
|
+
end
|
12
|
+
|
7
13
|
class Command < CLAide::Command
|
8
14
|
self.command = "vsclean"
|
9
15
|
self.version = VsClean::VERSION
|
@@ -11,19 +17,29 @@ module VsClean
|
|
11
17
|
|
12
18
|
def self.options
|
13
19
|
[
|
20
|
+
['[--local]', '(DEFAULT) Delete caches and temporary files in the current directory'],
|
14
21
|
['[--global]', 'Delete global caches and temporary files'],
|
22
|
+
['[--full]', 'Delete local *and* global temporary files'],
|
15
23
|
['[--dry-run]', 'Simulate deletion (list all files and directories that would be deleted)']
|
16
24
|
].concat(super)
|
17
25
|
end
|
18
26
|
|
19
27
|
def initialize(argv)
|
20
28
|
@dryrun = argv.flag?("dry-run")
|
21
|
-
|
29
|
+
|
30
|
+
@mode = Mode::LOCAL if argv.flag?("local", true)
|
31
|
+
@mode = Mode::GLOBAL if argv.flag?("global")
|
32
|
+
@mode = Mode::FULL if argv.flag?("full")
|
33
|
+
|
22
34
|
super
|
23
35
|
end
|
24
36
|
|
25
37
|
def run
|
26
|
-
paths = @
|
38
|
+
paths = case @mode
|
39
|
+
when Mode::LOCAL; collect_local_paths
|
40
|
+
when Mode::GLOBAL; collect_global_paths
|
41
|
+
when Mode::FULL; collect_global_paths.push(*collect_local_paths)
|
42
|
+
end
|
27
43
|
|
28
44
|
if paths.none?
|
29
45
|
Console.log_step("All good... nothing to clean!")
|
@@ -37,9 +53,9 @@ module VsClean
|
|
37
53
|
|
38
54
|
def collect_global_paths
|
39
55
|
home = File.expand_path("~")
|
40
|
-
paths = Dir.glob(home + "/AppData/
|
41
|
-
paths.push(*Dir.glob(home + "/AppData/Microsoft/WebsiteCache"))
|
56
|
+
paths = Dir.glob(home + "/AppData/Microsoft/WebsiteCache")
|
42
57
|
paths.push(*Dir.glob(home + "/AppData/Local/Microsoft/**/ComponentModelCache"))
|
58
|
+
paths.push(*Dir.glob(home + "/AppData/Local/JetBrains/**/SolutionCaches"))
|
43
59
|
end
|
44
60
|
|
45
61
|
def collect_local_paths
|
data/lib/info.rb
CHANGED