Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clean): Improve messages while task cleaning all #165

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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