On Wed, Sep 4, 2019 at 4:07 PM Tom Browder <tom.brow...@gmail.com> wrote:

> On Wed, Sep 4, 2019 at 05:53 Fernando Santagata <nando.santag...@gmail.com>
> wrote:
>
>>
>> On Wed, Sep 4, 2019 at 12:21 PM William Michels <w...@caa.columbia.edu>
>> wrote:
>>
>>> Hi Fernando, I'm not sure I understand. Is this for module
>>> development? And you want to purge old versions of a module you're
>>> developing, before doing a 'git push'?
>>
>>
> I have never had a problem with:
>
>     cd my-module
>     zef install .
>     zef uninstall My::Module
>

I was trying to do that automatically from a git pre-push hook.

I opened an "issue", actually a feature request, in the zef repository on
GitHub. I received some suggestions and right now my pre-push script looks
like this:

#/bin/sh

zef uninstall "$(perl6 -MJSON::Fast -e 'my $meta = from-json slurp
”META6.json”; say $meta<name>, $meta<auth> ?? ”:auth<$meta<auth>>” !! ””,
$meta<version> ?? ”:ver<$meta<version>>” !! ””')"
zef install . --force-install

which is not exactly "clean." What I mean is that zef is able to read the
META6.json file, because it does it when it installs a module from a
directory using "zef install .". It might do the same when asked to
uninstall what's in a certain directory, using something along the lines of
"zef uninstall .".

-- 
Fernando Santagata

Reply via email to