[Music] Check return value of call to git-annex-find

This commit is contained in:
Daniel - 2019-06-10 09:45:24 +02:00
parent 29d138f968
commit 402bfc7643
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 7 additions and 5 deletions

View File

@ -45,15 +45,17 @@ Generates playlist that is comprised of exactly those files that
are match it. Assumes `emms-source-file-default-directory to be
part of a git-annex repository, and will complain otherwise."
(interactive "smatch expression: ")
;; XXX check for git-annex
(let* ((default-directory emms-source-file-default-directory))
(db/-emms-playlist-from-files
(->> (split-string (with-output-to-string
(with-current-buffer standard-output
(apply #'call-process
"git" nil t nil
"annex" "find"
(split-string match-expression))))
(let ((return-value (apply #'call-process
"git" nil t nil
"annex" "find"
(split-string match-expression))))
(unless (zerop return-value)
(error "Call to `git-annex-find failed: %s"
(buffer-string))))))
"\n")
(cl-remove-if-not #'(lambda (path)
(and (not (string-empty-p path))