Retriggering a shards postinstall?

Some tools that I use like Ameba and cr-source-typer execute a postinstall (example: cr-source-typer/shard.yml at master · Vici37/cr-source-typer · GitHub ) and will place it’s executable in the bin directory of the current project, but when the system is updated, shared libraries change and then the shard binary has to be rebuilt, but shards does not seem to have an easy way to re trigger the postinstall without removing the dependency from the shard.lock file and running shards install <dependency>.

There is any other way to do it? Would be great is shards could keep track of the installed binaries from dependencies and check if their linked libraries are still valid or something like that.

1 Like

You can always run it manually.

  1. goto the folder where the shards live.
  2. follow the command defined on scripts → postinstall in the shard.yml

I run into this when I’m developing a shard with a CLI and I need to add something to it to accommodate an app.

To work around it I usually run rm -rf lib/$shard_name && shards. Removing the shard from lib will cause the shards CLI to reinstall it, including running its postinstall command and copying over any of the executables.

2 Likes