|
17 | 17 | (defvar eask-no-cleaning-operation-p nil |
18 | 18 | "Set to non-nil if there is no cleaning operation done.") |
19 | 19 |
|
| 20 | +(defmacro eask--clean-section (title &rest body) |
| 21 | + "Print clean up TITLE and execute BODY." |
| 22 | + (declare (indent 1)) |
| 23 | + `(let (eask-no-cleaning-operation-p) |
| 24 | + (eask-with-progress |
| 25 | + (format "%s... \n" ,title) |
| 26 | + (progn ,@body) |
| 27 | + (if eask-no-cleaning-operation-p "skipped ✗" "done ✓")))) |
| 28 | + |
20 | 29 | (eask-start |
21 | | - (let (eask-no-cleaning-operation-p) |
22 | | - (eask-with-progress |
23 | | - "Cleaning workspace... \n" |
24 | | - (eask-call "clean/workspace") |
25 | | - (if eask-no-cleaning-operation-p "skipped ✗" "done ✓"))) |
| 30 | + (eask--clean-section "Cleaning workspace" |
| 31 | + (eask-call "clean/workspace")) |
| 32 | + (eask-msg "") |
| 33 | + (eask--clean-section "Cleaning byte-compile files" |
| 34 | + (eask-call "clean/elc")) |
26 | 35 | (eask-msg "") |
27 | | - (let (eask-no-cleaning-operation-p) |
28 | | - (eask-with-progress |
29 | | - "Cleaning byte-compile files... \n" |
30 | | - (eask-call "clean/elc") |
31 | | - (if eask-no-cleaning-operation-p "skipped ✗" "done ✓"))) |
| 36 | + (eask--clean-section "Cleaning dist" |
| 37 | + (eask-call "clean/dist")) |
32 | 38 | (eask-msg "") |
33 | | - (let (eask-no-cleaning-operation-p) |
34 | | - (eask-with-progress |
35 | | - "Cleaning dist... \n" |
36 | | - (eask-call "clean/dist") |
37 | | - (if eask-no-cleaning-operation-p "skipped ✗" "done ✓"))) |
| 39 | + (eask--clean-section "Cleaning autoloads file" |
| 40 | + (eask-call "clean/autoloads")) |
38 | 41 | (eask-msg "") |
39 | | - (let (eask-no-cleaning-operation-p) |
40 | | - (eask-with-progress |
41 | | - "Cleaning log files... \n" |
42 | | - (eask-call "clean/log-file") |
43 | | - (if eask-no-cleaning-operation-p "skipped ✗" "done ✓")))) |
| 42 | + (eask--clean-section "Cleaning log files" |
| 43 | + (eask-call "clean/log-file"))) |
44 | 44 |
|
45 | 45 | ;;; clean/all.el ends here |
0 commit comments