Skip to content

Commit daab641

Browse files
committed
ci: fix upgrade test
1 parent d127ed1 commit daab641

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

test/commands/outdated_upgrade/make-outdate.el

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,15 @@
2626

2727
(eask-pkg-init)
2828

29+
(require 'f)
30+
2931
(defconst make-outdate-version "20001122.1234"
3032
"Outdate version.")
3133

32-
(defun mo--shell-execute (cmd &rest args)
33-
"Return non-nil if CMD executed succesfully with ARGS."
34-
(= 0 (shell-command (concat cmd " "
35-
(mapconcat #'shell-quote-argument args " ")))))
36-
37-
(defun mo--move-path (path dest)
38-
"Move PATH to DEST."
39-
(mo--shell-execute (if eask-is-windows "move" "mv") (expand-file-name path) (expand-file-name dest)))
40-
4134
(defun make-outdate-package (name)
4235
"Make package (NAME) outdate."
4336
(let* ((dir (file-name-directory (locate-library name)))
44-
(pkg (concat dir name "-pkg.el"))
45-
(main (concat dir name ".el")))
37+
(pkg (concat dir name "-pkg.el")))
4638
(with-current-buffer (find-file pkg)
4739
(goto-char (point-min))
4840
(when (re-search-forward "\"[0-9.]*\"" nil t)
@@ -56,16 +48,9 @@
5648
(let ((dest (expand-file-name (concat name "-" make-outdate-version "/") package-user-dir)))
5749
(eask-info "Moving %s" dir)
5850
(eask-info " to %s" dest)
59-
(mo--move-path dir dest))
60-
(with-current-buffer (find-file main)
61-
(when (re-search-forward "Package-Version: [0-9.]*" nil t)
62-
(save-excursion
63-
(let ((end (point)))
64-
(backward-sexp)
65-
(delete-region (point) end)
66-
(insert (format "%s" make-outdate-version)))))
67-
(save-buffer)
68-
(kill-this-buffer))))
51+
(ignore-errors (make-directory dest t))
52+
(f-copy-contents dir dest)
53+
(ignore-errors (delete-directory dir t)))))
6954

7055
(make-outdate-package "dash")
7156
(make-outdate-package "f")

0 commit comments

Comments
 (0)