-
Notifications
You must be signed in to change notification settings - Fork 40
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
:init does not work with (prodigy-callback ...) #70
Comments
Is the build step sync or async? |
The following modification enables it but I'm not comfortable enough with the code to create a pull request and there are still bugs in my related code.. (-when-let (init (prodigy-service-init service))
(prodigy-callback-with-plist init service)
;; (funcall init service)
) |
Given the minor patch above the following seems to work alright now. (eval-after-load "prodigy"
'(progn
(prodigy-define-tag
:name 'bin
:hide t
:path (lambda ()
(file-truename default-directory)))
(defun prodigy-go-build (service)
(prodigy-insert-output
service
"- - - - - - - - - - - - - - - - - - - - - -\n")
(let ((cmd (plist-get service :command)))
(when (file-exists-p cmd)
(delete-file cmd))
(with-temp-buffer
(let ((success (eq 0 (call-process "go" nil t nil "build"
"-o" cmd (plist-get service :go-main)))))
(prodigy-insert-output service (buffer-string))
(unless success
(error "prodigy-go-build-failed"))))))
(prodigy-define-tag
:name 'go-build
:hide t
:init (prodigy-callback (service) (prodigy-go-build service))
:tags '(bin))
(prodigy-define-service
:name "project01 central"
:cwd "/home/a00001/repos/go/src/gitlab.aOrganisation.se/project01/project01"
:command "project01-central"
:args '("-logtostderr" "-v=10")
:go-main "cmd/project01-central/project01-central.go"
:kill-signal 'sigkill
:tags '(project01 go-build))
(prodigy-define-service
:name "project01 client"
:cwd "/home/a00001/repos/go/src/gitlab.aOrganisation.se/project01/project01"
:init (prodigy-callback (service) (prodigy-go-build service))
:command "project01-client"
:go-main "cmd/project01-client/project01-client.go"
:kill-signal 'sigkill
:tags '(go-build project01))
(prodigy-define-service
:name "project01 hot"
:cwd "/home/aUser/repos/go/src/gitlab.aOrganisation.se/project01/project01"
:go-main "make.go"
:command "make"
:args '("hot")
:kill-signal 'sigkill
:tags '(project01 go-build)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it intended or just overlooked?
My use case right now is adding a build step to build a binary before launching it.
The text was updated successfully, but these errors were encountered: