Skip to content

Commit

Permalink
feat(clean): Improve messages while task cleaning all (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 authored Mar 15, 2023
1 parent 9e15a9f commit 7eb4a0f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
* Allow few commands' execution without any Eask-file (#159)
* Add command `cat` (#160)
* Improve messages while processing package transaction (#164)
* Improve messages while task cleaning all (#165)

## 0.8.x
> Released Mar 08, 2023
Expand Down
32 changes: 16 additions & 16 deletions lisp/clean/all.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
(defvar eask-no-cleaning-operation-p nil
"Set to non-nil if there is no cleaning operation done.")

(defvar eask--clean-tasks-total 0
"Total clean tasks.")
(defvar eask--clean-tasks-count 0
"Count cleaning task.")

(defvar eask--clean-tasks-cleaned 0
"Total cleaned tasks")
Expand All @@ -27,33 +27,33 @@
"Print clean up TITLE and execute BODY."
(declare (indent 1))
`(let (eask-no-cleaning-operation-p)
(cl-incf eask--clean-tasks-count)
(eask-with-progress
(format "%s... " ,title)
(concat " - [" (eask-2str eask--clean-tasks-count) "/6] "
(format "%s... " ,title))
(eask-with-verbosity 'debug ,@body)
(progn
(cl-incf eask--clean-tasks-total)
(if eask-no-cleaning-operation-p
"skipped ✗"
(cl-incf eask--clean-tasks-cleaned)
"done ✓")))))
(if eask-no-cleaning-operation-p
"skipped ✗"
(cl-incf eask--clean-tasks-cleaned)
"done ✓"))))

(eask-start
(eask--clean-section "Cleaning workspace"
(eask--clean-section (format "Cleaning %s" (ansi-green "workspace"))
(eask-call "clean/workspace"))
(eask--clean-section "Cleaning byte-compile files"
(eask--clean-section (format "Cleaning %s files" (ansi-green "byte-compile (.elc)"))
(eask-call "clean/elc"))
(eask--clean-section "Cleaning dist"
(eask--clean-section (format "Cleaning %s" (ansi-green "dist"))
(eask-call "clean/dist"))
(eask--clean-section "Cleaning autoloads file"
(eask--clean-section (format "Cleaning %s file" (ansi-green "autoloads"))
(eask-call "clean/autoloads"))
(eask--clean-section "Cleaning pkg-file"
(eask--clean-section (format "Cleaning %s" (ansi-green "pkg-file"))
(eask-call "clean/pkg-file"))
(eask--clean-section "Cleaning log files"
(eask--clean-section (format "Cleaning %s files" (ansi-green "log"))
(eask-call "clean/log-file"))
(eask-msg "")
(eask-info "(Total of %s task%s cleaned, %s skipped)"
eask--clean-tasks-cleaned
(eask--sinr eask--clean-tasks-cleaned "" "s")
(- eask--clean-tasks-total eask--clean-tasks-cleaned)))
(- eask--clean-tasks-count eask--clean-tasks-cleaned)))

;;; clean/all.el ends here

0 comments on commit 7eb4a0f

Please sign in to comment.