postuninstall hook #1451

Closed
me-ascii opened this Issue Aug 6, 2014 · 36 comments

Projects

None yet
@me-ascii
me-ascii commented Aug 6, 2014

Please

"scripts": {
        "postinstall": "grunt",
        "postuninstall": "grunt"
    }
@sheerun
Contributor
sheerun commented Aug 6, 2014

It's breaking change + We don't want bower to run this way

@sheerun sheerun closed this Aug 6, 2014
@me-ascii
me-ascii commented Aug 6, 2014

Ok, so how to run something after component uninstall?
Can you explain, please, what is breaking?

@sheerun
Contributor
sheerun commented Aug 6, 2014

Please read the hooks documentation: https://github.com/bower/bower/blob/master/HOOKS.md

@me-ascii
me-ascii commented Aug 6, 2014

Just finished re-reading :)
But haven't answer: why you reject postuninstall hook.
So why?
Or which 'best practice' you can advise to make same action?

@sheerun
Contributor
sheerun commented Aug 6, 2014

The issue description wasn't clear on that, so I assumed you just have problems with hooks in general or want to add "grunt" posthook by default.

@sindresorhus Probably has an answer for your question as he implemented it.

@sheerun sheerun reopened this Aug 6, 2014
@sindresorhus
Member

No idea. I didn't implement it. Though there probably should be a postuninstall hook.

@sheerun sheerun added this to the 1.4.x milestone Aug 6, 2014
@sheerun sheerun added the enhancement label Aug 6, 2014
@nickcmaynard

Definitely a +1 from me here.

Wiredep suggests adding a postinstall hook to add wiring to HTML files for new packages - it'd be great if there was a corresponding postuninstall to enable the removal operation.

@sheerun sheerun added the help wanted label Jan 5, 2015
@whyleee
whyleee commented Jan 8, 2015

๐Ÿ‘

@jvisser jvisser pushed a commit to jvisser/SpringTest that referenced this issue Jan 10, 2015
Jeroen Add postuninstall hook hoping for future support see: bower/bower#1451 b5dbd04
@MattDiMu

+1
I'm also using the post-installation-hook with bower-requirejs to update the config file. It's not a big issue to have unnecessary dependencies there after an uninstallation, but it's suboptimal...

@silvenon

It would definitely be nice to have this hook. ๐Ÿ‘

@atropo
atropo commented Feb 2, 2015

+1 for me too, it would be great with wiredep

@sonicparke

+1 for me too. Would very nice.

@PeterKow
PeterKow commented Feb 3, 2015

+1, simple automatisation and keeps things clean ๐Ÿ‘

@mixmode
mixmode commented Feb 4, 2015

+1

@ip2k
ip2k commented Feb 4, 2015

+1 , esp. for the use-case of wiredep (so it can automatically remove all the script / css tags in your HTML files after Bower uninstalls a thing)

@ahmadalfy

+1, need postuninstall hook for grunt wiredep too.

@maccurt
maccurt commented Mar 10, 2015

Uh duh, yes we need this. If it will inject my css and js when I install something IT SHOULD remove it when I uninstall something. This just seems logical right? Am I missing something? I do appreciate all you do.. Just saying..

@sheerun
Contributor
sheerun commented Mar 11, 2015

It's not as easy as you think to implement. PR with tests is appreciated :)

@maccurt
maccurt commented Mar 11, 2015

I understand. There is probably something I don't know about. I totally get that. As a developer I am often asked to do something that is estimated to take only 4 hours, a couple weeks later we found out that really was not as easy as the business owner thought it would be

@pmentz
pmentz commented Apr 7, 2015

+1 from me, too
As far as I have seen, there is already a PR #1681 maybe that one would need some support to pass the checks?

@sdvim
sdvim commented Apr 24, 2015

+1, though I found a temporary workaround using grunt-contrib-watch:

    watch: {
      bower: {
        files: ['bower.json', '.bowerrc'],
        tasks: ['wiredep']
      }
   }

And of course you can add templating tasks after wiredep, like jade for example, to generate the updated files.

@thomas-j-moffett

+1 for wiredep for me too!

@mwcz
mwcz commented May 18, 2015

+1 for me, bower-requirejs user. I have to run bower-requirejs on every grunt build, but I'd much rather run it from a postuninstall hook.

@anilnatha

+1. This hook combined with wiredep would be very helpful when completing the workflow for uninstalling packages via bower.

@lukelarsen

+1 for the postuninstall hook.

@kringon
kringon commented Aug 17, 2015

I'll +1 this aswell -> don't really see how you implement a postinstall hook without a postuninstall ๐Ÿ’ƒ

@Jnull
Jnull commented Aug 22, 2015

I agree, +1 to postuninstall hook, i endorse this.

@letalumil

+1 for the postuninstall hook.

@Leotomas

+1

@jimsheen
jimsheen commented Oct 7, 2015

+1

@westonganger

+1

@olso
olso commented Oct 22, 2015

+1

@SubZero-0

+1 :)

@sheerun
Contributor
sheerun commented Apr 14, 2016

Implemented in #2252 and will be released in bower 1.8

@sheerun sheerun closed this Apr 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment