I recently added some hooks to Juju, the required action is the same for both the hooks so I created a script and symlinked install and post-refresh to it.
This gave me a couple of issues when trying to upload to the store, issues that weren’t flagged by snapcraft on build so where a surprise to me.
First issue was an unknown hook file in snap/hooks/ (in this case the script that I wrote and symlinked to).
I went to rectify this (as I didn’t want to have to review that any timed we changed it) so that the script file lived outside of the hooks dir (snap/local, which gets dumped) but now I get failures as the install and post-refresh hooks aren’t executable (the script they are linked to is though) and everything works when I use snapcraft to build it and install/test it in a fresh lxd container.
Does this mean that the best thing I can do that the store will be happy with is have 2 identical scripts in the hooks dir or is there something better I can do?
I wasn’t able to see any details around this in these docs https://docs.snapcraft.io/supported-snap-hooks/3795 nor in a search of this forum here.