File tree Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ to actually set up the systems."
494
494
; ; NOTE: Use this as project root?
495
495
(defun qob-primary-root ()
496
496
" Return the primary system path."
497
- (let ((path (car ( cdr (qob-primary-system-entry) ))))
497
+ (let ((path (cdr (qob-primary-system-entry))))
498
498
(qob-file-name-directory path)))
499
499
500
500
(defun qob-find-asd-file (name)
@@ -608,6 +608,11 @@ Set up the systems; on contrary, you should use the function
608
608
(defvar qob-dist-path " dist/"
609
609
" Default path where to place the package artifact." )
610
610
611
+ (defun qob-dist-path ()
612
+ " Path to dist path."
613
+ (let ((path (or (qob-args 0 ) qob-dist-path)))
614
+ (qob-expand-fn path)))
615
+
611
616
; ;
612
617
; ;; Entry
613
618
@@ -693,4 +698,10 @@ Set up the systems; on contrary, you should use the function
693
698
(qob-msg " ✓ Loading Qob file in ~A ... done!" qob-file)
694
699
(qob-msg " ✗ Loading Qob file... missing!" )))))
695
700
701
+ ; ;
702
+ ; ;; Commad variables
703
+
704
+ (defvar qob-no-cleaning-operation-p nil
705
+ " Set to non-nil if there is no cleaning operation done." )
706
+
696
707
; ;; End of lisp/_prepare.lisp
Original file line number Diff line number Diff line change 9
9
10
10
; ;; Code
11
11
12
+ (defun qob-clean-dist ()
13
+ " Clean up the dist files."
14
+ (let* ((name (qob-primary-system-name))
15
+ (system (qob-primary-system))
16
+ (version (asdf :component-version system))
17
+ (f-name (qob-format " ~A -~A " name version))
18
+ (f-tar (qob-expand-fn (qob-format " ~A .tar" f-name) qob-dist-path))
19
+ (deleted 0 )
20
+ (delete-dir nil ))
21
+ (when (probe-file f-tar)
22
+ (ignore-errors (delete-file f-tar))
23
+ (incf deleted))
24
+ (setq delete-dir (ignore-errors (uiop :delete-empty-directory qob-dist-path)))
25
+ (qob-msg " " )
26
+ (qob-info " (Total of ~A file~A and ~A directory deleted)" deleted
27
+ (qob--sinr deleted " " " s" )
28
+ (if delete-dir " 1" " 0" ))))
29
+
12
30
(qob-start
13
- ; ; TODO: ..
14
- )
31
+ (let ((qob-dist-path (qob-dist-path)))
32
+ (if (probe-file qob-dist-path)
33
+ (qob-clean-dist)
34
+ (progn
35
+ (qob-info " (No dist folder needs to be cleaned)" qob-dist-path)
36
+ (setq qob-no-cleaning-operation-p t )))))
15
37
16
38
; ;; End of lisp/clean/dist.lisp
Original file line number Diff line number Diff line change 23
23
(ignore-errors (delete-directory f-dir :recursive t ))
24
24
(ensure-directories-exist f-dir)
25
25
26
+ ; ; Copy files over
26
27
(dolist (path (qob-system-files))
27
28
(let* ((path (qob-2str path))
28
29
(rel-path (qob-s-replace root " " path))
41
42
(qob-s-remove-prefix
42
43
(qob-2str qob-dist-path)
43
44
tar))))
45
+ ; ; Delete cache folder
46
+ (ignore-errors (delete-directory f-dir :recursive t ))
47
+
44
48
(qob-msg " " )
45
49
(qob-info " (Built in ~A .tar)" tar)))
46
50
47
51
(qob-start
48
- (let* ((qob-dist-path (or (qob-args 0 ) qob-dist-path))
49
- (qob-dist-path (qob-expand-fn qob-dist-path)))
52
+ (let ((qob-dist-path (qob-dist-path)))
50
53
(ensure-directories-exist qob-dist-path)
51
54
52
55
(let ((name (qob-primary-system-name))
You can’t perform that action at this time.
0 commit comments