@datatruck/cli 0.27.0 → 0.29.0

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.
Files changed (151) hide show
  1. package/Action/BackupAction.d.ts +75 -34
  2. package/Action/BackupAction.js +302 -246
  3. package/Action/CleanCacheAction.d.ts +8 -4
  4. package/Action/CleanCacheAction.js +8 -5
  5. package/Action/ConfigAction.d.ts +12 -5
  6. package/Action/ConfigAction.js +14 -18
  7. package/Action/CopyAction.d.ts +51 -0
  8. package/Action/CopyAction.js +165 -0
  9. package/Action/InitAction.d.ts +3 -3
  10. package/Action/InitAction.js +9 -9
  11. package/Action/PruneAction.d.ts +10 -16
  12. package/Action/PruneAction.js +37 -34
  13. package/Action/RestoreAction.d.ts +49 -24
  14. package/Action/RestoreAction.js +164 -195
  15. package/Action/SnapshotsAction.d.ts +8 -8
  16. package/Action/SnapshotsAction.js +9 -9
  17. package/CHANGELOG.md +513 -0
  18. package/Command/BackupCommand.d.ts +7 -4
  19. package/Command/BackupCommand.js +14 -26
  20. package/Command/CleanCacheCommand.d.ts +4 -4
  21. package/Command/CleanCacheCommand.js +26 -5
  22. package/Command/CommandAbstract.d.ts +10 -7
  23. package/Command/CommandAbstract.js +4 -1
  24. package/Command/ConfigCommand.d.ts +6 -9
  25. package/Command/ConfigCommand.js +13 -8
  26. package/Command/CopyCommand.d.ts +16 -0
  27. package/Command/CopyCommand.js +66 -0
  28. package/Command/InitCommand.d.ts +4 -4
  29. package/Command/InitCommand.js +13 -17
  30. package/Command/PruneCommand.d.ts +4 -10
  31. package/Command/PruneCommand.js +13 -12
  32. package/Command/RestoreCommand.d.ts +1 -1
  33. package/Command/RestoreCommand.js +13 -21
  34. package/Command/SnapshotsCommand.d.ts +4 -4
  35. package/Command/SnapshotsCommand.js +16 -15
  36. package/Command/StartServerCommand.d.ts +3 -3
  37. package/Config/Config.d.ts +11 -0
  38. package/Config/Config.js +18 -0
  39. package/Config/PrunePolicyConfig.d.ts +2 -2
  40. package/Factory/CommandFactory.d.ts +27 -34
  41. package/Factory/CommandFactory.js +27 -54
  42. package/Factory/RepositoryFactory.d.ts +1 -1
  43. package/Factory/RepositoryFactory.js +3 -3
  44. package/Factory/TaskFactory.d.ts +1 -1
  45. package/Factory/TaskFactory.js +3 -3
  46. package/Repository/DatatruckRepository.d.ts +10 -8
  47. package/Repository/DatatruckRepository.js +47 -25
  48. package/Repository/GitRepository.d.ts +9 -8
  49. package/Repository/GitRepository.js +22 -25
  50. package/Repository/RepositoryAbstract.d.ts +39 -37
  51. package/Repository/RepositoryAbstract.js +4 -5
  52. package/Repository/ResticRepository.d.ts +9 -8
  53. package/Repository/ResticRepository.js +30 -28
  54. package/Task/GitTask.d.ts +6 -7
  55. package/Task/GitTask.js +24 -30
  56. package/Task/MariadbTask.d.ts +4 -5
  57. package/Task/MariadbTask.js +26 -32
  58. package/Task/MssqlTask.d.ts +5 -3
  59. package/Task/MssqlTask.js +11 -12
  60. package/Task/MysqlDumpTask.d.ts +10 -3
  61. package/Task/MysqlDumpTask.js +102 -32
  62. package/Task/ScriptTask.d.ts +23 -18
  63. package/Task/ScriptTask.js +34 -24
  64. package/Task/SqlDumpTaskAbstract.d.ts +8 -3
  65. package/Task/SqlDumpTaskAbstract.js +32 -20
  66. package/Task/TaskAbstract.d.ts +24 -25
  67. package/Task/TaskAbstract.js +6 -10
  68. package/cli.js +13 -5
  69. package/config.schema.json +89 -1
  70. package/package.json +4 -5
  71. package/utils/DataFormat.d.ts +23 -12
  72. package/utils/DataFormat.js +36 -14
  73. package/utils/cli.d.ts +3 -9
  74. package/utils/cli.js +19 -55
  75. package/utils/crypto.d.ts +1 -0
  76. package/utils/crypto.js +15 -0
  77. package/utils/datatruck/client.d.ts +2 -0
  78. package/utils/datatruck/client.js +3 -0
  79. package/utils/datatruck/config.d.ts +2 -0
  80. package/utils/datatruck/config.js +18 -3
  81. package/utils/datatruck/paths.d.ts +5 -9
  82. package/utils/datatruck/paths.js +2 -2
  83. package/utils/datatruck/snapshot.d.ts +5 -2
  84. package/utils/datatruck/snapshot.js +12 -22
  85. package/utils/date.d.ts +21 -4
  86. package/utils/date.js +46 -24
  87. package/utils/fs.d.ts +16 -11
  88. package/utils/fs.js +81 -48
  89. package/utils/list.d.ts +64 -0
  90. package/utils/list.js +145 -0
  91. package/utils/mysql.d.ts +2 -0
  92. package/utils/mysql.js +21 -2
  93. package/utils/process.d.ts +1 -0
  94. package/utils/process.js +24 -31
  95. package/utils/progress.d.ts +33 -0
  96. package/utils/progress.js +113 -0
  97. package/utils/steps.d.ts +11 -0
  98. package/utils/steps.js +22 -10
  99. package/utils/stream.d.ts +7 -0
  100. package/utils/stream.js +10 -0
  101. package/utils/string.d.ts +0 -1
  102. package/utils/string.js +1 -13
  103. package/utils/tar.d.ts +10 -3
  104. package/utils/tar.js +73 -45
  105. package/utils/temp.d.ts +26 -0
  106. package/utils/temp.js +133 -0
  107. package/utils/virtual-fs.d.ts +6 -2
  108. package/utils/virtual-fs.js +6 -0
  109. package/Action/BackupSessionsAction.d.ts +0 -13
  110. package/Action/BackupSessionsAction.js +0 -18
  111. package/Action/RestoreSessionsAction.d.ts +0 -13
  112. package/Action/RestoreSessionsAction.js +0 -18
  113. package/Command/BackupSessionsCommand.d.ts +0 -12
  114. package/Command/BackupSessionsCommand.js +0 -92
  115. package/Command/RestoreSessionsCommand.d.ts +0 -12
  116. package/Command/RestoreSessionsCommand.js +0 -91
  117. package/Decorator/EntityDecorator.d.ts +0 -11
  118. package/Decorator/EntityDecorator.js +0 -17
  119. package/Entity/BackupSessionEntity.d.ts +0 -6
  120. package/Entity/BackupSessionEntity.js +0 -25
  121. package/Entity/BackupSessionRepositoryEntity.d.ts +0 -6
  122. package/Entity/BackupSessionRepositoryEntity.js +0 -25
  123. package/Entity/BackupSessionTaskEntity.d.ts +0 -5
  124. package/Entity/BackupSessionTaskEntity.js +0 -24
  125. package/Entity/CrudEntityAbstract.d.ts +0 -5
  126. package/Entity/CrudEntityAbstract.js +0 -9
  127. package/Entity/RestoreSessionEntity.d.ts +0 -5
  128. package/Entity/RestoreSessionEntity.js +0 -24
  129. package/Entity/RestoreSessionRepositoryEntity.d.ts +0 -6
  130. package/Entity/RestoreSessionRepositoryEntity.js +0 -25
  131. package/Entity/RestoreSessionTaskEntity.d.ts +0 -5
  132. package/Entity/RestoreSessionTaskEntity.js +0 -24
  133. package/Entity/StateEntityAbstract.d.ts +0 -9
  134. package/Entity/StateEntityAbstract.js +0 -12
  135. package/Factory/EntityFactory.d.ts +0 -6
  136. package/Factory/EntityFactory.js +0 -40
  137. package/SessionDriver/ConsoleSessionDriver.d.ts +0 -42
  138. package/SessionDriver/ConsoleSessionDriver.js +0 -208
  139. package/SessionDriver/SessionDriverAbstract.d.ts +0 -77
  140. package/SessionDriver/SessionDriverAbstract.js +0 -28
  141. package/SessionDriver/SqliteSessionDriver.d.ts +0 -20
  142. package/SessionDriver/SqliteSessionDriver.js +0 -173
  143. package/SessionManager/BackupSessionManager.d.ts +0 -45
  144. package/SessionManager/BackupSessionManager.js +0 -218
  145. package/SessionManager/RestoreSessionManager.d.ts +0 -47
  146. package/SessionManager/RestoreSessionManager.js +0 -218
  147. package/SessionManager/SessionManagerAbstract.d.ts +0 -18
  148. package/SessionManager/SessionManagerAbstract.js +0 -36
  149. package/migrations/001-initial.sql +0 -98
  150. package/utils/entity.d.ts +0 -4
  151. package/utils/entity.js +0 -10
package/CHANGELOG.md ADDED
@@ -0,0 +1,513 @@
1
+ # @datatruck/cli
2
+
3
+ ## 0.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`363fc0d`](https://github.com/swordev/datatruck/commit/363fc0d8158aba6ae6a171769ef01dcd0fd2de08) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--prune` option to the backup command
8
+
9
+ - [`e47ed46`](https://github.com/swordev/datatruck/commit/e47ed46c47fc93d7d5f3b76935d425c6b42ae9a5) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--last` option to the copy command
10
+
11
+ - [`0a760a2`](https://github.com/swordev/datatruck/commit/0a760a2038ff77966936b3a9a0a8e865f4dae4c4) Thanks [@juanrgm](https://github.com/juanrgm)! - Add global prune policy to the config
12
+
13
+ ### Patch Changes
14
+
15
+ - [`1c5084d`](https://github.com/swordev/datatruck/commit/1c5084dab2058ab9699f1a908f2581cd03da0468) Thanks [@juanrgm](https://github.com/juanrgm)! - Rename `--no-restore-path` to `--initial`
16
+
17
+ - [`5fe3e91`](https://github.com/swordev/datatruck/commit/5fe3e91e994238cf901e570c9b9ef8254d79afa1) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix prune policy
18
+
19
+ - [`bd4d42e`](https://github.com/swordev/datatruck/commit/bd4d42e0261f79bdb69dd55abc30ef8bb0bfdcd7) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix reports
20
+
21
+ ## 0.28.0
22
+
23
+ ### Minor Changes
24
+
25
+ - [`b50b10b`](https://github.com/swordev/datatruck/commit/b50b10bb29a15db0b4dadd3de499b9cd6738d706) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace cli interface and global refactoring
26
+
27
+ - [`89b0856`](https://github.com/swordev/datatruck/commit/89b0856b2a5bfc42458a9bcb271a04f2dce26098) Thanks [@juanrgm](https://github.com/juanrgm)! - Add telegram report config
28
+
29
+ - [`1745715`](https://github.com/swordev/datatruck/commit/17457154930f15865858e89b7f3932c617dfddf4) Thanks [@juanrgm](https://github.com/juanrgm)! - Enhance output table formatting
30
+
31
+ - [`8fa2fe0`](https://github.com/swordev/datatruck/commit/8fa2fe0a1213cf9614bb8c5bbe999d0d8e7130e8) Thanks [@juanrgm](https://github.com/juanrgm)! - Add copy command
32
+
33
+ - [`e3d54c3`](https://github.com/swordev/datatruck/commit/e3d54c34df8ba42e77040d183d993808c8a7cdbb) Thanks [@juanrgm](https://github.com/juanrgm)! - Add json/table format to all commands
34
+
35
+ - [`d59d435`](https://github.com/swordev/datatruck/commit/d59d435fc1a244da944ad0c36bf1dcf7735ba289) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `compress` option to `mysql-dump` task
36
+
37
+ - [`802d6a5`](https://github.com/swordev/datatruck/commit/802d6a577f46bfccc1c1a5b8c4431976cd6d7820) Thanks [@juanrgm](https://github.com/juanrgm)! - Show backup summary
38
+
39
+ ### Patch Changes
40
+
41
+ - [`93e8e83`](https://github.com/swordev/datatruck/commit/93e8e830792f7d8957e89787c981e6a45ae4d02d) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `minFreeDiskSpace` config
42
+
43
+ - [`1ad7fd9`](https://github.com/swordev/datatruck/commit/1ad7fd99f6e8f6d8128ea35e7c680cc3618d6ac4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix id filter in prune action
44
+
45
+ - [`5d1ece0`](https://github.com/swordev/datatruck/commit/5d1ece0760c317c71175250812e43fc866bcfc5a) Thanks [@juanrgm](https://github.com/juanrgm)! - Verify mysql dump files
46
+
47
+ - [`8c00e9c`](https://github.com/swordev/datatruck/commit/8c00e9c78a656807d09d147c9b1017c2a1b8d127) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix bsdtar execution
48
+
49
+ ## 0.27.0
50
+
51
+ ### Minor Changes
52
+
53
+ - [`e6485ad`](https://github.com/swordev/datatruck/commit/e6485ad80258d3b1c30f3efb1a2549a5c2760878) Thanks [@juanrgm](https://github.com/juanrgm)! - Add datatruck server
54
+
55
+ ## 0.26.2
56
+
57
+ ### Patch Changes
58
+
59
+ - [`627adbd`](https://github.com/swordev/datatruck/commit/627adbd8114510371f451b674b007dc2093fee96) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `--no-restore-path` option
60
+
61
+ ## 0.26.1
62
+
63
+ ### Patch Changes
64
+
65
+ - [`2ca1421`](https://github.com/swordev/datatruck/commit/2ca142106ddca9e0ca53ef906f4412acd3a5bfae) Thanks [@juanrgm](https://github.com/juanrgm)! - Add meta property to the package config
66
+
67
+ ## 0.26.0
68
+
69
+ ### Minor Changes
70
+
71
+ - [`ff54d83`](https://github.com/swordev/datatruck/commit/ff54d835a4ea5c54c47c75e735549b1f49d66e5e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add option to disable restore paths
72
+
73
+ ## 0.25.0
74
+
75
+ ### Minor Changes
76
+
77
+ - [`7a1adf0`](https://github.com/swordev/datatruck/commit/7a1adf0624d4306f40bfd1943105cbfaa64a566c) Thanks [@juanrgm](https://github.com/juanrgm)! - Add node steps to `include`/`exclude` package options
78
+
79
+ ## 0.24.0
80
+
81
+ ### Minor Changes
82
+
83
+ - [`f1615b2`](https://github.com/swordev/datatruck/commit/f1615b216cf635bd2c08d68bad818d50855f314b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix and enhance `script` task
84
+
85
+ ## 0.23.3
86
+
87
+ ### Patch Changes
88
+
89
+ - [`ea3cbc9`](https://github.com/swordev/datatruck/commit/ea3cbc98aee49151bd1b9422a2c7dadb29479751) Thanks [@juanrgm](https://github.com/juanrgm)! - Apply permissions to the root path in `datatruck` repository
90
+
91
+ ## 0.23.2
92
+
93
+ ### Patch Changes
94
+
95
+ - [`61d0221`](https://github.com/swordev/datatruck/commit/61d022187463ea16e9a34d0b995808b687414a61) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `mysql-dump` task
96
+
97
+ - [`3f80194`](https://github.com/swordev/datatruck/commit/3f8019448b3b529cb9b70e1e5bbe7ec99aec95a4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix folder permissions in `datatruck` repository
98
+
99
+ ## 0.23.1
100
+
101
+ ### Patch Changes
102
+
103
+ - [`899aa7a`](https://github.com/swordev/datatruck/commit/899aa7af5204b13010643a900279456e737a154d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `mysql-dump` progress
104
+
105
+ ## 0.23.0
106
+
107
+ ### Minor Changes
108
+
109
+ - [`fa5d44d`](https://github.com/swordev/datatruck/commit/fa5d44dff24b26d976bed385bd20981fa767e089) Thanks [@juanrgm](https://github.com/juanrgm)! - Add concurrency config to `mysql-dump` task
110
+
111
+ ## 0.22.2
112
+
113
+ ### Patch Changes
114
+
115
+ - [`80eeded`](https://github.com/swordev/datatruck/commit/80eeded073aae970385e1efb04acc4ec222efa25) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix cross-device link
116
+
117
+ ## 0.22.1
118
+
119
+ ### Patch Changes
120
+
121
+ - [`e21ad9f`](https://github.com/swordev/datatruck/commit/e21ad9f33bd6cd28cc4c47485643905dd92dcb57) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix folder permissions in `mysql-dump` task
122
+
123
+ - [`5e5ebf5`](https://github.com/swordev/datatruck/commit/5e5ebf53b0cb87160e7887e2a6372617e19d38b1) Thanks [@juanrgm](https://github.com/juanrgm)! - Hide MySQL credentials
124
+
125
+ ## 0.22.0
126
+
127
+ ### Minor Changes
128
+
129
+ - [`d0649f1`](https://github.com/swordev/datatruck/commit/d0649f1f7d4a7d891bea19793cfcb24d752a0d5c) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `csv` backup/restore format to `mysql-dump` task
130
+
131
+ ### Patch Changes
132
+
133
+ - [`2e76917`](https://github.com/swordev/datatruck/commit/2e7691753b0a74c1f0653960882d13fbcf7d0567) Thanks [@juanrgm](https://github.com/juanrgm)! - Improve import performance in the `mysql-dump` task
134
+
135
+ ## 0.21.1
136
+
137
+ ### Patch Changes
138
+
139
+ - [`0d863e8`](https://github.com/swordev/datatruck/commit/0d863e86d6deb30b79a45171f01d7cf4604250dd) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid listing tar twice
140
+
141
+ - [`5045457`](https://github.com/swordev/datatruck/commit/5045457f3cd9512b27d29049fc37ba418ed95e0a) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix tar extracting
142
+
143
+ - [`8f0bd77`](https://github.com/swordev/datatruck/commit/8f0bd77267a92da7eee05adc3bb85dee0ba97391) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `sql-dump` tasks
144
+
145
+ ## 0.21.0
146
+
147
+ ### Minor Changes
148
+
149
+ - [`211c914`](https://github.com/swordev/datatruck/commit/211c914e42b97213e81163511778b84b1ae2e9af) Thanks [@juanrgm](https://github.com/juanrgm)! - Use multi core for tar
150
+
151
+ ## 0.20.0
152
+
153
+ ### Minor Changes
154
+
155
+ - [`13f9331`](https://github.com/swordev/datatruck/commit/13f933191f56f93e2eee0467e272998520b36195) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace node-tar by tar
156
+
157
+ ## 0.19.0
158
+
159
+ ### Minor Changes
160
+
161
+ - [`452a878`](https://github.com/swordev/datatruck/commit/452a878b04bf6dcf4632423f1455648e9e196697) Thanks [@juanrgm](https://github.com/juanrgm)! - Replace 7zip by tar
162
+
163
+ ## 0.18.0
164
+
165
+ ### Minor Changes
166
+
167
+ - [`dba2162`](https://github.com/swordev/datatruck/commit/dba21624fa916e39824b9f998b58f9f9c3c2b1eb) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `compress` and `parallel` options to MariaDB task config
168
+
169
+ ### Patch Changes
170
+
171
+ - [`0b783ee`](https://github.com/swordev/datatruck/commit/0b783ee4c8d112e516ba5923ebf5d792050d14cc) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
172
+
173
+ - [`305dc49`](https://github.com/swordev/datatruck/commit/305dc49c3bc0ebc562cb478e705dfc6a9da6658f) Thanks [@juanrgm](https://github.com/juanrgm)! - Throw error if mkdir fails
174
+
175
+ ## 0.17.2
176
+
177
+ ### Patch Changes
178
+
179
+ - [`27b7260`](https://github.com/swordev/datatruck/commit/27b726075a0e81769b841c4ce4c8b508f55f0bde) Thanks [@juanrgm](https://github.com/juanrgm)! - Ignore uncompleted snapshots
180
+
181
+ ## 0.17.1
182
+
183
+ ### Patch Changes
184
+
185
+ - [`d6ff955`](https://github.com/swordev/datatruck/commit/d6ff955618527e8bad99f05a779c1f9e08fc863e) Thanks [@juanrgm](https://github.com/juanrgm)! - Wait for stdout pipe to close
186
+
187
+ - [`c3cb5b9`](https://github.com/swordev/datatruck/commit/c3cb5b9d25af164dbbd58d1d7623f56c55fc7dbb) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix pretty-json format
188
+
189
+ ## 0.17.0
190
+
191
+ ### Minor Changes
192
+
193
+ - [`821096f`](https://github.com/swordev/datatruck/commit/821096f67cd3bcce310b8e42fc7ccda109b42672) Thanks [@juanrgm](https://github.com/juanrgm)! - Add grouping by id in `snapshots` command
194
+
195
+ ### Patch Changes
196
+
197
+ - [`5a5e9c6`](https://github.com/swordev/datatruck/commit/5a5e9c62f3b6afded36d949c3149d475da17751b) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
198
+
199
+ - [`b9fbbc9`](https://github.com/swordev/datatruck/commit/b9fbbc98ca147ae9a88b214586ef722a9212116b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix filter by repository
200
+
201
+ ## 0.16.2
202
+
203
+ ### Patch Changes
204
+
205
+ - [`14865df`](https://github.com/swordev/datatruck/commit/14865df18b784d756aa1b4896f59ca6310eaeca4) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
206
+
207
+ - [`d91e6f8`](https://github.com/swordev/datatruck/commit/d91e6f8a024b14a15f9b9b97d5adc9b21c821a76) Thanks [@juanrgm](https://github.com/juanrgm)! - Delete temporary directories
208
+
209
+ ## 0.16.1
210
+
211
+ ### Patch Changes
212
+
213
+ - [`62ce7c4`](https://github.com/swordev/datatruck/commit/62ce7c4d4ee6edc0375f3c1ad1e7bfe8912a2f3c) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix unzip progress
214
+
215
+ * [`3fd4258`](https://github.com/swordev/datatruck/commit/3fd42588011353d744be2f964ab24cf0bdd690bf) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restore progress in datatruck repository
216
+
217
+ ## 0.16.0
218
+
219
+ ### Minor Changes
220
+
221
+ - [`e25867a`](https://github.com/swordev/datatruck/commit/e25867a49217e682c0fee7e1822a12daa583b168) Thanks [@juanrgm](https://github.com/juanrgm)! - New backup structure in datatruck repository
222
+
223
+ * [`b65f080`](https://github.com/swordev/datatruck/commit/b65f080d7eca5588bce533e988067bd432da3c50) Thanks [@juanrgm](https://github.com/juanrgm)! - Show all progress steps
224
+
225
+ - [`e603aee`](https://github.com/swordev/datatruck/commit/e603aee22febd7cc23056caeeb9f9304957199d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Add progress stats in the `sql-dump` tasks
226
+
227
+ ### Patch Changes
228
+
229
+ - [`dae957b`](https://github.com/swordev/datatruck/commit/dae957b20f519d1bc0f6b046074ae2ad02a071dc) Thanks [@juanrgm](https://github.com/juanrgm)! - Show zip progress
230
+
231
+ * [`7ba3dd3`](https://github.com/swordev/datatruck/commit/7ba3dd3521fc10140adc178810cc2b6153f0f5df) Thanks [@juanrgm](https://github.com/juanrgm)! - Enable multithread in 7zip
232
+
233
+ - [`1024225`](https://github.com/swordev/datatruck/commit/102422501f629f50164db439e69a456725579cbe) Thanks [@juanrgm](https://github.com/juanrgm)! - Show full error stack when the error is not controlled
234
+
235
+ * [`09db164`](https://github.com/swordev/datatruck/commit/09db164db462077289b66931e82f162a92558720) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix backup action in datatruck repository
236
+
237
+ - [`2b9b2bb`](https://github.com/swordev/datatruck/commit/2b9b2bbb407b0b84a4b7fe3cd8773d6326983e8a) Thanks [@juanrgm](https://github.com/juanrgm)! - Unify progress bars
238
+
239
+ ## 0.15.0
240
+
241
+ ### Minor Changes
242
+
243
+ - [`c73ceec`](https://github.com/swordev/datatruck/commit/c73ceec5ccb6a824fe6a6fceee56700705191fba) Thanks [@juanrgm](https://github.com/juanrgm)! - Detail the progress in all actions
244
+
245
+ ## 0.14.0
246
+
247
+ ### Minor Changes
248
+
249
+ - [`91fe442`](https://github.com/swordev/datatruck/commit/91fe44257fa58400d7ce6a4678747e034e94228a) Thanks [@juanrgm](https://github.com/juanrgm)! - Show progress and apply permissions in datatruck repository
250
+
251
+ ## 0.13.1
252
+
253
+ ### Patch Changes
254
+
255
+ - [`bfd61c7`](https://github.com/swordev/datatruck/commit/bfd61c7c5cdec7aea4f66193094786797231b1d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Enhance 7zip performance
256
+
257
+ * [`a208200`](https://github.com/swordev/datatruck/commit/a20820044fe8dac007bbc70de840b27735c689ef) Thanks [@juanrgm](https://github.com/juanrgm)! - Skip not found file errors during backups
258
+
259
+ - [`442bd3d`](https://github.com/swordev/datatruck/commit/442bd3d7376e6c546cfcba69a80048e90e11a488) Thanks [@juanrgm](https://github.com/juanrgm)! - Deny additional properties in SQL dump task config
260
+
261
+ ## 0.13.0
262
+
263
+ ### Minor Changes
264
+
265
+ - [`64cbb10`](https://github.com/swordev/datatruck/commit/64cbb10ea2526612e9f1183c878f146dbe4cea13) Thanks [@juanrgm](https://github.com/juanrgm)! - Save and show snapshot size
266
+
267
+ * [`297d120`](https://github.com/swordev/datatruck/commit/297d1202c49a3a6b4a5eafc3871359c1af637d52) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `progress` and `progress-interval` global options
268
+
269
+ - [`cb0ea35`](https://github.com/swordev/datatruck/commit/cb0ea35161ce8f67c40c6c77d1169d648ac0dfcd) Thanks [@juanrgm](https://github.com/juanrgm)! - Show restic restore progress
270
+
271
+ * [`357b995`](https://github.com/swordev/datatruck/commit/357b995c041f3167290a5ce9ae4f9a8d122f2a10) Thanks [@juanrgm](https://github.com/juanrgm)! - Rename local repository to datatruck
272
+
273
+ ### Patch Changes
274
+
275
+ - [`aca9634`](https://github.com/swordev/datatruck/commit/aca9634313d562065a3e09efde8adf31b9939f89) Thanks [@juanrgm](https://github.com/juanrgm)! - Use local cache in the restic repositories
276
+
277
+ * [`25f0cbb`](https://github.com/swordev/datatruck/commit/25f0cbb2754ca1b082a51e929c373f88825bc18d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix undefined progress of restic
278
+
279
+ ## 0.12.1
280
+
281
+ ### Patch Changes
282
+
283
+ - [`23bab2a`](https://github.com/swordev/datatruck/commit/23bab2ad73801398c799759cc275be2b17350545) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package config option
284
+
285
+ ## 0.12.0
286
+
287
+ ### Minor Changes
288
+
289
+ - [`0effb38`](https://github.com/swordev/datatruck/commit/0effb38d1cc0b50ba43cd2948c7ff98d2b17325d) Thanks [@juanrgm](https://github.com/juanrgm)! - Add package config filter
290
+
291
+ ### Patch Changes
292
+
293
+ - [`31446fb`](https://github.com/swordev/datatruck/commit/31446fb69273ac1619cdf2f8965f8b702da5882f) Thanks [@juanrgm](https://github.com/juanrgm)! - Throw controlled error when package config not found
294
+
295
+ ## 0.11.7
296
+
297
+ ### Patch Changes
298
+
299
+ - [`303dbf6`](https://github.com/swordev/datatruck/commit/303dbf63127c2bafd8a24c5733fa8b33d311f3ff) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow non file password in restic repository url
300
+
301
+ ## 0.11.6
302
+
303
+ ### Patch Changes
304
+
305
+ - [`3a3c54d`](https://github.com/swordev/datatruck/commit/3a3c54db7075882604a3fc0fd8827271ab04ba29) Thanks [@juanrgm](https://github.com/juanrgm)! - Exlude files in restic repository
306
+
307
+ ## 0.11.5
308
+
309
+ ### Patch Changes
310
+
311
+ - [`cee6fee`](https://github.com/swordev/datatruck/commit/cee6fee924a8ae637a8f3bfece03890d6ad34ddf) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid scan all excluded files
312
+
313
+ ## 0.11.4
314
+
315
+ ### Patch Changes
316
+
317
+ - [`6328aec`](https://github.com/swordev/datatruck/commit/6328aece04027d76d2092bd916671d49c91cdc6d) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix task name filter
318
+
319
+ ## 0.11.3
320
+
321
+ ### Patch Changes
322
+
323
+ - [`6aeac04`](https://github.com/swordev/datatruck/commit/6aeac04803c18a3f91d87f215857b250e1e7defd) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `packageTaskNames` filter
324
+
325
+ ## 0.11.2
326
+
327
+ ### Patch Changes
328
+
329
+ - [`9432df5`](https://github.com/swordev/datatruck/commit/9432df56f6c6444a59d98e79cf4b7db9f4d35854) Thanks [@juanrgm](https://github.com/juanrgm)! - Show zip progress
330
+
331
+ * [`c16daa2`](https://github.com/swordev/datatruck/commit/c16daa22d922bd610a161f37911fdb6f52666d38) Thanks [@juanrgm](https://github.com/juanrgm)! - Sort table names in the SQL dump tasks
332
+
333
+ ## 0.11.1
334
+
335
+ ### Patch Changes
336
+
337
+ - [`c65035c`](https://github.com/swordev/datatruck/commit/c65035cb6e9b8f5082f7b6d2ad59078ea1bd6abb) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix WSL system patch
338
+
339
+ ## 0.11.0
340
+
341
+ ### Minor Changes
342
+
343
+ - [`8aa3c1a`](https://github.com/swordev/datatruck/commit/8aa3c1a1334870cc11b610b3b0a9bf10b0a97126) Thanks [@juanrgm](https://github.com/juanrgm)! - Add predefined output templates
344
+
345
+ ### Patch Changes
346
+
347
+ - [`763a724`](https://github.com/swordev/datatruck/commit/763a72473505232884e1b3871f2f4d1c55bb74d6) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix file copy in WSL system
348
+
349
+ ## 0.10.0
350
+
351
+ ### Minor Changes
352
+
353
+ - [`bc9a0dd`](https://github.com/swordev/datatruck/commit/bc9a0ddf2bfb9353545c28d9cbd12e592328024e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `mirrorRepoNames` config option
354
+
355
+ ### Patch Changes
356
+
357
+ - [`795936c`](https://github.com/swordev/datatruck/commit/795936c1d2add7819ff5f40679313e1e594aeb7e) Thanks [@juanrgm](https://github.com/juanrgm)! - Show error stack trace if directory does not exist
358
+
359
+ * [`d0d77b6`](https://github.com/swordev/datatruck/commit/d0d77b6c3d4eb0461c176981b165e20b49826082) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
360
+
361
+ ## 0.9.0
362
+
363
+ ### Minor Changes
364
+
365
+ - [`05de947`](https://github.com/swordev/datatruck/commit/05de947264727cddb79293eca6cb0b43382eab6b) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `storedPrograms` config option in `mysql-dump` task
366
+
367
+ ### Patch Changes
368
+
369
+ - [`ef99bdf`](https://github.com/swordev/datatruck/commit/ef99bdf0301b5bbdf965c1fa1d00e78edce1c931) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
370
+
371
+ ## 0.8.0
372
+
373
+ ### Minor Changes
374
+
375
+ - [`8c421ab`](https://github.com/swordev/datatruck/commit/8c421ab0adb6f2d5bc81e91fa387c5daa848f411) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--package-task` option to snapshot command
376
+
377
+ ## 0.7.0
378
+
379
+ ### Minor Changes
380
+
381
+ - [`3b8d6da`](https://github.com/swordev/datatruck/commit/3b8d6da01495799aceb848a63b35b8c46a7d1b0e) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `--package-task` cli option
382
+
383
+ * [`69b34a0`](https://github.com/swordev/datatruck/commit/69b34a02b9cade48df2b071a92a8f79d5cfec23e) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow restore multiple backups over the same database
384
+
385
+ - [`69caf26`](https://github.com/swordev/datatruck/commit/69caf26881272331bd4c8d7d345b3b85d33e33ac) Thanks [@juanrgm](https://github.com/juanrgm)! - Add cli short option to `--tag`
386
+
387
+ * [`377f0de`](https://github.com/swordev/datatruck/commit/377f0de345c9c8f45c772ac47e4ded81e91725d7) Thanks [@juanrgm](https://github.com/juanrgm)! - Rename cli short option to `-rt`
388
+
389
+ ### Patch Changes
390
+
391
+ - [`c03200a`](https://github.com/swordev/datatruck/commit/c03200a6347d1e9f9fdad86dcb22df30bbefcab4) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix `sql-dump` tasks
392
+
393
+ * [`f56a4bc`](https://github.com/swordev/datatruck/commit/f56a4bcb429a674c13f32de73985cd67eb1acc23) Thanks [@juanrgm](https://github.com/juanrgm)! - Show full error message
394
+
395
+ - [`4324422`](https://github.com/swordev/datatruck/commit/4324422550474619811a8d455af55bc6e3b08aeb) Thanks [@juanrgm](https://github.com/juanrgm)! - Use connection port in `mysql-dump` task
396
+
397
+ ## 0.6.1
398
+
399
+ ### Patch Changes
400
+
401
+ - [`0ba6229`](https://github.com/swordev/datatruck/commit/0ba6229348c109a59783e72242ab7c0e61f25e36) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix progress bar in restic repository
402
+
403
+ ## 0.6.0
404
+
405
+ ### Minor Changes
406
+
407
+ - [`0c6877d`](https://github.com/swordev/datatruck/commit/0c6877d189761e75dd434b0a8d72b71621d024de) Thanks [@juanrgm](https://github.com/juanrgm)! - Show more progress stats
408
+
409
+ * [`751e1f6`](https://github.com/swordev/datatruck/commit/751e1f6d6b33d3fa96eb40d998fdd140ce0e3875) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `fileCopyConcurrency` option
410
+
411
+ - [`05487e6`](https://github.com/swordev/datatruck/commit/05487e6a33f875a3afb7ff0815b16da6f2a41301) Thanks [@juanrgm](https://github.com/juanrgm)! - Parse InnoDB error in `MariadbTask` to avoid infinite wait
412
+
413
+ ### Patch Changes
414
+
415
+ - [`b62a6f8`](https://github.com/swordev/datatruck/commit/b62a6f8a82409339afd65d4f96476eb57bbfb5a2) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve target/restore path in local repository
416
+
417
+ ## 0.5.0
418
+
419
+ ### Minor Changes
420
+
421
+ - [`5aeb2af`](https://github.com/swordev/datatruck/commit/5aeb2afb96692e00bdba501b58df9cc0e02dceaa) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `enabled` option to repository config
422
+
423
+ * [`75de836`](https://github.com/swordev/datatruck/commit/75de8369356cf02ed3fd5c58b1f9bea66432cda8) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow restic password without file
424
+
425
+ ## 0.4.0
426
+
427
+ ### Minor Changes
428
+
429
+ - [`eeb00a6`](https://github.com/swordev/datatruck/commit/eeb00a69d75c91da40711ae79475612b1d5193b6) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `tempDir` config option
430
+
431
+ ## 0.3.2
432
+
433
+ ### Patch Changes
434
+
435
+ - [`8957c3b`](https://github.com/swordev/datatruck/commit/8957c3b5846606db8b825fef357445210f2a3ac3) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restic progress parser
436
+
437
+ * [`2989718`](https://github.com/swordev/datatruck/commit/29897185e3d6659359d51ab2212351005137f86c) Thanks [@juanrgm](https://github.com/juanrgm)! - Show closing reason
438
+
439
+ - [`b9e0843`](https://github.com/swordev/datatruck/commit/b9e0843c7970944cfd30a7d2a543f515adfa60e4) Thanks [@juanrgm](https://github.com/juanrgm)! - Show restic progress in megabytes
440
+
441
+ ## 0.3.1
442
+
443
+ ### Patch Changes
444
+
445
+ - [`c3bb4c6`](https://github.com/swordev/datatruck/commit/c3bb4c609887c5525cf35487ea237750addb6e75) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix restic stdout parser
446
+
447
+ ## 0.3.0
448
+
449
+ ### Minor Changes
450
+
451
+ - [`d63fd25`](https://github.com/swordev/datatruck/commit/d63fd25ffa8d2e539d2125dfd6a3f55020086804) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `snapshotDate` param
452
+
453
+ * [`486ef4a`](https://github.com/swordev/datatruck/commit/486ef4add27ae1dbfd166b16c257522f43537ecd) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve params in `include` and `exclude`
454
+
455
+ - [`617dae2`](https://github.com/swordev/datatruck/commit/617dae2c8ed90e6e65e8109f03cfad0e64bd7c02) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `script` task
456
+
457
+ ### Patch Changes
458
+
459
+ - [`d1b3ea9`](https://github.com/swordev/datatruck/commit/d1b3ea9c9540d30898c00490963523a4fbc68193) Thanks [@juanrgm](https://github.com/juanrgm)! - Avoid use gitignore if is not necessary in restic repository
460
+
461
+ ## 0.2.0
462
+
463
+ ### Minor Changes
464
+
465
+ - [`120460c`](https://github.com/swordev/datatruck/commit/120460c8824cef4184e43f571a4cc0798b899b66) Thanks [@juanrgm](https://github.com/juanrgm)! - Enable `include` option in restic repository
466
+
467
+ ### Patch Changes
468
+
469
+ - [`e30ede3`](https://github.com/swordev/datatruck/commit/e30ede371bc7ab3fc1cd47758fdac7a28e8e2705) Thanks [@juanrgm](https://github.com/juanrgm)! - Resolve `RESTIC_PASSWORD_FILE` path
470
+
471
+ * [`8539d28`](https://github.com/swordev/datatruck/commit/8539d285b2c51d700aa811cd772d573fa0d613eb) Thanks [@juanrgm](https://github.com/juanrgm)! - Allow empty backup in restic repository
472
+
473
+ ## 0.1.0
474
+
475
+ ### Minor Changes
476
+
477
+ - [`88d46cd`](https://github.com/swordev/datatruck/commit/88d46cd56293df4c6fc21a9ad61d6236ac91f325) Thanks [@juanrgm](https://github.com/juanrgm)! - Add `custom` output format
478
+
479
+ ### Patch Changes
480
+
481
+ - [`24a1e5e`](https://github.com/swordev/datatruck/commit/24a1e5e86336e7a92556287e49548dc542f0e579) Thanks [@juanrgm](https://github.com/juanrgm)! - Update dependencies
482
+
483
+ ## 0.0.6
484
+
485
+ ### Patch Changes
486
+
487
+ - [`8de6e6c`](https://github.com/swordev/datatruck/commit/8de6e6ceddb59635cb4634d884e7690eeaf59bac) Thanks [@juanrgm](https://github.com/juanrgm)! - Publish migrations
488
+
489
+ ## 0.0.5
490
+
491
+ ### Patch Changes
492
+
493
+ - [`78cb0c1`](https://github.com/swordev/datatruck/commit/78cb0c17558543841cd7080dc4c672e6cbfd5634) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix docker image
494
+
495
+ ## 0.0.4
496
+
497
+ ### Patch Changes
498
+
499
+ - [`d9e534b`](https://github.com/swordev/datatruck/commit/d9e534bd968acf9cd1c93f20e6152c004cb1f23b) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix package file read
500
+
501
+ * [`b882c58`](https://github.com/swordev/datatruck/commit/b882c58183e9a75abc876645e18d7b67186dd662) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix read of migrations
502
+
503
+ ## 0.0.3
504
+
505
+ ### Patch Changes
506
+
507
+ - [`051a7da`](https://github.com/swordev/datatruck/commit/051a7da225fcfea1c30a4fbfa8aea1b8f5538367) Thanks [@juanrgm](https://github.com/juanrgm)! - Fix dist files
508
+
509
+ ## 0.0.2
510
+
511
+ ### Patch Changes
512
+
513
+ - [`0911351`](https://github.com/swordev/datatruck/commit/09113517e1a77f2d2a1e19e4c3d9af7da1e28415) Thanks [@juanrgm](https://github.com/juanrgm)! - Publish docker image
@@ -1,7 +1,8 @@
1
+ import { BackupAction } from "../Action/BackupAction";
1
2
  import { RepositoryConfigType } from "../Config/RepositoryConfig";
2
- import { If } from "../utils/ts";
3
+ import { If, Unwrap } from "../utils/ts";
3
4
  import { CommandAbstract } from "./CommandAbstract";
4
- export type BackupCommandOptionsType<TResolved = false> = {
5
+ export type BackupCommandOptions<TResolved = false> = {
5
6
  package?: If<TResolved, string[]>;
6
7
  packageTask?: If<TResolved, string[]>;
7
8
  repository?: If<TResolved, string[]>;
@@ -9,8 +10,10 @@ export type BackupCommandOptionsType<TResolved = false> = {
9
10
  tag?: If<TResolved, string[]>;
10
11
  dryRun?: boolean;
11
12
  date?: string;
13
+ prune?: boolean;
12
14
  };
13
- export declare class BackupCommand extends CommandAbstract<BackupCommandOptionsType<false>, BackupCommandOptionsType<true>> {
14
- onOptions(): import("../utils/cli").OptionsType<BackupCommandOptionsType<false>, BackupCommandOptionsType<true>>;
15
+ export type BackupCommandResult = Unwrap<BackupAction["exec"]>;
16
+ export declare class BackupCommand extends CommandAbstract<BackupCommandOptions<false>, BackupCommandOptions<true>> {
17
+ onOptions(): import("../utils/cli").OptionsType<BackupCommandOptions<false>, BackupCommandOptions<true>>;
15
18
  onExec(): Promise<0 | 1>;
16
19
  }
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BackupCommand = void 0;
4
4
  const BackupAction_1 = require("../Action/BackupAction");
5
5
  const ConfigAction_1 = require("../Action/ConfigAction");
6
- const AppError_1 = require("../Error/AppError");
7
- const ConsoleSessionDriver_1 = require("../SessionDriver/ConsoleSessionDriver");
8
- const SqliteSessionDriver_1 = require("../SessionDriver/SqliteSessionDriver");
9
- const BackupSessionManager_1 = require("../SessionManager/BackupSessionManager");
10
6
  const string_1 = require("../utils/string");
11
7
  const CommandAbstract_1 = require("./CommandAbstract");
12
8
  class BackupCommand extends CommandAbstract_1.CommandAbstract {
@@ -45,6 +41,10 @@ class BackupCommand extends CommandAbstract_1.CommandAbstract {
45
41
  description: "Date time (ISO)",
46
42
  option: "--date <value>",
47
43
  },
44
+ prune: {
45
+ description: "Prune backups",
46
+ option: "--prune",
47
+ },
48
48
  });
49
49
  }
50
50
  async onExec() {
@@ -59,30 +59,18 @@ class BackupCommand extends CommandAbstract_1.CommandAbstract {
59
59
  dryRun: this.options.dryRun,
60
60
  verbose: verbose > 0,
61
61
  date: this.options.date,
62
- });
63
- const sessionManager = new BackupSessionManager_1.BackupSessionManager({
64
- driver: new SqliteSessionDriver_1.SqliteSessionDriver({
65
- verbose: verbose > 1,
66
- }),
67
- altDrivers: [
68
- new ConsoleSessionDriver_1.ConsoleSessionDriver({
69
- verbose: verbose > 0,
70
- progress: this.globalOptions.progress,
71
- }),
72
- ],
73
- verbose: verbose > 1,
62
+ tty: this.globalOptions.tty,
63
+ progress: this.globalOptions.progress,
74
64
  progressInterval: this.globalOptions.progressInterval,
65
+ streams: this.streams,
66
+ prune: this.options.prune,
75
67
  });
76
- const result = await backup.exec(sessionManager);
77
- if (result.errors.length) {
78
- return 1;
79
- }
80
- else if (!result.total) {
81
- throw new AppError_1.AppError("None package config found");
82
- }
83
- else {
84
- return 0;
85
- }
68
+ const result = await backup.exec();
69
+ if (this.globalOptions.outputFormat)
70
+ backup
71
+ .dataFormat(result, { streams: this.streams, verbose })
72
+ .log(this.globalOptions.outputFormat);
73
+ return result.some((item) => item.error) ? 1 : 0;
86
74
  }
87
75
  }
88
76
  exports.BackupCommand = BackupCommand;
@@ -1,6 +1,6 @@
1
1
  import { CommandAbstract } from "./CommandAbstract";
2
- export type CleanCacheCommandOptionsType<TResolved = false> = {};
3
- export declare class CleanCacheCommand extends CommandAbstract<CleanCacheCommandOptionsType<false>, CleanCacheCommandOptionsType<true>> {
4
- onOptions(): import("../utils/cli").OptionsType<CleanCacheCommandOptionsType<false>, CleanCacheCommandOptionsType<true>>;
5
- onExec(): Promise<number>;
2
+ export type CleanCacheCommandOptions<TResolved = false> = {};
3
+ export declare class CleanCacheCommand extends CommandAbstract<CleanCacheCommandOptions<false>, CleanCacheCommandOptions<true>> {
4
+ onOptions(): import("../utils/cli").OptionsType<CleanCacheCommandOptions<false>, CleanCacheCommandOptions<true>>;
5
+ onExec(): Promise<0 | 1>;
6
6
  }
@@ -1,20 +1,41 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.CleanCacheCommand = void 0;
4
7
  const CleanCacheAction_1 = require("../Action/CleanCacheAction");
5
- const fs_1 = require("../utils/fs");
8
+ const DataFormat_1 = require("../utils/DataFormat");
6
9
  const CommandAbstract_1 = require("./CommandAbstract");
10
+ const bytes_1 = __importDefault(require("bytes"));
7
11
  class CleanCacheCommand extends CommandAbstract_1.CommandAbstract {
8
12
  onOptions() {
9
13
  return this.returnsOptions({});
10
14
  }
11
15
  async onExec() {
12
- const action = new CleanCacheAction_1.CleanCacheAction({
16
+ const cleanCache = new CleanCacheAction_1.CleanCacheAction({
13
17
  verbose: !!this.globalOptions.verbose,
14
18
  });
15
- console.info(`Cleaning ${(0, fs_1.parentTmpDir)()}...`);
16
- await action.exec();
17
- return 0;
19
+ const result = await cleanCache.exec();
20
+ const dataFormat = new DataFormat_1.DataFormat({
21
+ streams: this.streams,
22
+ json: result,
23
+ table: {
24
+ headers: [
25
+ {
26
+ value: "Path",
27
+ },
28
+ {
29
+ value: "Freed disk space",
30
+ },
31
+ ],
32
+ rows: () => [[result.path, (0, bytes_1.default)(result.freedSize)]],
33
+ },
34
+ });
35
+ await cleanCache.exec();
36
+ if (this.globalOptions.outputFormat)
37
+ dataFormat.log(this.globalOptions.outputFormat);
38
+ return result.errors.length ? 1 : 0;
18
39
  }
19
40
  }
20
41
  exports.CleanCacheCommand = CleanCacheCommand;