I’m having a hard time using golang as a configure hook. My problem is that using the go plugin puts the built executable into parts/mypart/install/bin. I want it in the final snap in snap/hooks/.
Suggestions please.
I’m having a hard time using golang as a configure hook. My problem is that using the go plugin puts the built executable into parts/mypart/install/bin. I want it in the final snap in snap/hooks/.
Suggestions please.
Referring to this, it seems you could get the resulting binary into snap/hooks/
by utilizing the organize
keyword. Have you tried that?
My part uses the go plugin, not the dump plugin (which has the organize keyword), so I am not sure how to use both on the same directory.
Ah, the organize
keyword is part of the snapcraft core: it’s not plugin-specific, it applies to everything.
Thanks kyrofa: I got it working with an install scriptlet:
parts:
…
hooks:
plugin: go
source: hooks
install: |
mkdir -p $SNAPCRAFT_PART_INSTALL/snap/hooks
mv $SNAPCRAFT_PART_INSTALL/bin/hooks $SNAPCRAFT_PART_INSTALL/snap/hooks/configure
Yeah that works too. Great!