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

[Support]: automatically rebuilding packages #26

Closed
progfolio opened this issue Nov 2, 2022 · 2 comments
Closed

[Support]: automatically rebuilding packages #26

progfolio opened this issue Nov 2, 2022 · 2 comments

Comments

@progfolio
Copy link
Owner

progfolio commented Nov 2, 2022

Is this the correct way to tell Elpaca to rebuild a package on every init?

(add-hook 'elpaca-after-init-hook (lambda () (elpaca-rebuild 'my-package t)))

Originally posted by @suconakh in #22 (comment)

@progfolio
Copy link
Owner Author

I would not recommend doing it that way.
elpaca-after-init-hook will run after the package has already been loaded. So you will end up with the older version of the package loaded despite the rebuild. It's also wasteful in that it will rebuild no matter whether the package has changed or not. Another approach is to add a file or per-directory variable which rebuilds the package when it is saved.

For example:

(add-hook 'after-save-hook
          (defun my/rebuild (interactive) (elpaca-rebuild 'example))
          nil 'local)

@suconakh
Copy link

suconakh commented Nov 2, 2022

This will work for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants