Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation via Composer #27

Closed
sidneywidmer opened this issue Aug 28, 2015 · 5 comments
Closed

Installation via Composer #27

sidneywidmer opened this issue Aug 28, 2015 · 5 comments

Comments

@sidneywidmer
Copy link

unfortunately the installation via composer doesn't work out of the box. You would have to put the contents of the folder supertable directly in the root. Or is there another way?

@engram-design
Copy link
Member

@sidneywidmer Yeah, I did realise that just after I did it, which kind of makes the whole thing a bit useless. Unfortunately, I prefer to keep the keep the plugin outside of the root, and have the plugin as a folder named correctly so its ready to go. This is just to save confusion for users in naming the plugin folder (I know its pretty simple - but still), but also to allow for things like the Readme, screenshots, and any additional files to be separate.

I'm not a big user of Composer, so not sure if there is indeed a better way to target a repo subdirectory. From my research, it looks like this isn't possible. With an upcoming (next year) Craft Plugin store, this will solve this.

So yeah, I'm a little torn at what the best situation for everyone is - people using Composed, and people just installing the plugin copy/paste style.

@sidneywidmer
Copy link
Author

seems like the only way to achieve this is to add the following snippet to the main composer file (the one which requires supertable). I know it's not really nice but at least it's a working solution if someone else needs something like this (only tested on osx, but this should be easy to adapt on windows/linux)

"scripts": {
    "post-autoload-dump": [
        "if test -d craft/plugins/supertable/supertable; then mv craft/plugins/supertable/supertable craft/plugins/_supertable && rm -rf craft/plugins/supertable && mv craft/plugins/_supertable craft/plugins/supertable; fi"
    ]
}

Thanks for your quick response!

@thijskaspers
Copy link

+1 for this.. Composer allows us to easily update the plugin with a single console command. More and more plugins are using it, so please reconsider @engram-design ;)

@iparr
Copy link

iparr commented Nov 4, 2016

I have another suggestion to match @sidneywidmer contribution:

"scripts": {
    "post-update-cmd": [
        "svn export https://github.com/engram-design/SuperTable/trunk/supertable app/craft/plugins/supertable --non-interactive --trust-server-cert --force"
    ]
},

When composer update is run, it uses SVN (which is installed by default on Macs and probably most Linux distros) to put everything in the right place. I know. I don't like it either. Would love to see adoption of a different structure for all Craft plugins.

@engram-design
Copy link
Member

Closing for now - this won't be implemented. Lets wait until the Plugin store, which will make all this meaningless (and likely work with Composer!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants