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

easy-hugo--version() crashed. #57

Closed
liuyinz opened this issue Mar 3, 2021 · 3 comments
Closed

easy-hugo--version() crashed. #57

liuyinz opened this issue Mar 3, 2021 · 3 comments
Labels

Comments

@liuyinz
Copy link
Contributor

liuyinz commented Mar 3, 2021

hugo version :
("hugo" "v0.81.0+extended" "darwin/amd64" "BuildDate=unknown")

Debug:
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
substring(nil 1)
(string-to-number (substring (nth 4 source) 1))
(let ((source (split-string (let ((temp-buffer (generate-new-buffer " temp" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ...) (and ... ...)))) " "))) (string-to-number (substring (nth 4 source) 1)))
easy-hugo--version()
(progn (easy-hugo--version))

@liuyinz
Copy link
Contributor Author

liuyinz commented Mar 3, 2021

  ;; HACK fix easy-hugo--view
  (defun easy-hugo--version-patch ()
    "Return the version of hugo."
    (let ((source (split-string
		           (with-temp-buffer
		             (shell-command-to-string (concat easy-hugo-bin " version")))
		           " ")))
      (string-to-number (substring (nth 1 source) 1))))
  (advice-add 'easy-hugo--version :override #'easy-hugo--version-patch)

For now ,I just add the advide to use, change to (substring (nth 1 source)

@liuyinz liuyinz closed this as completed Mar 3, 2021
@liuyinz
Copy link
Contributor Author

liuyinz commented Mar 3, 2021

Solved by d5c4e0f

@masasam
Copy link
Owner

masasam commented Mar 3, 2021

@liuyinz Thanks a lot.

@masasam masasam added the bug label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants