# Refactoring plugin installation

**URL:** https://meta.discourse.org/t/refactoring-plugin-installation/78848
**Category:** Development
**Created:** [January 24, 2018, 9:21am UTC](https://meta.discourse.org/t/refactoring-plugin-installation/78848 "2018-01-24T09:21:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ori\_Pekelman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ori_pekelman/32/124402_2.png) [@Ori\_Pekelman](https://meta.discourse.org/u/Ori_Pekelman)
#### Post date: [January 24, 2018, 9:21am UTC](https://meta.discourse.org/t/refactoring-plugin-installation/78848/1 "2018-01-24T09:21:20Z")

</div>

Hi,

I noticed that `public/plugins/` requires to be on a read/write mount, which is awkward as this is code under git control..  
I wanted to fix that .. but I got to the part where you install plugins .. and I find that part a bit awkward… could you please (if you remember 🙂 ) tell me the rationale behind the plugin activation part here:

> <https://github.com/discourse/discourse/blob/d2025e33cfa1efe23328222fccee9e8f83986a64/lib/plugin/instance.rb#L457>

I see you first create the target dir .. then brutally clean it up .. then symlink it..  
In the commit messages, I see something about not breaking Jenkins … (so possibly the rationale is stale..).

I’d be happy to try and have a stab at this… (and generally going over the whole thing making sure nothing under git control is on R/W mounts).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 24, 2018, 9:39am UTC](https://meta.discourse.org/t/refactoring-plugin-installation/78848/2 "2018-01-24T09:39:22Z")

</div>

I think I am fine for changing it so it only does the `ln` if for some reason the symlink does not already exist.

Also open to committing `/public/plugins/.gitignore` into the repo so the folder is always there and then we can get rid of the mkdir.

This is a very very fiddly change though I am not super comfortable accepting a first time PR for it.
