fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

Oil Create "App" clones 1.1/develop #35

Closed chadhutchins closed 12 years ago

chadhutchins commented 13 years ago

I'm not sure where to report this, so I'll start here. I created a few apps earlier this week (before the fuelphp branch name changes), and when I would run "oil create myApp" it would be using the master branch. This afternoon it seems that "oil create myApp" clones 1.1/develop. Shouldn't this default to the latest, released & stable branch?

dhrrgn commented 13 years ago

This is because we switched the default branch of the main fuel repo to 1.1/develop. I have temporarily changed it back to 1.0/develop until we update the installer script.

chadhutchins commented 13 years ago

Ahh, that makes sense. Thanks Dan.

On Wed, Aug 24, 2011 at 6:05 AM, dhorrigan < reply@reply.github.com>wrote:

This is because we switched the default branch of the main fuel repo to 1.1/develop. I have temporarily changed it back to 1.0/develop until we update the installer script.

Reply to this email directly or view it on GitHub: https://github.com/fuel/oil/issues/35#issuecomment-1888680

philsturgeon commented 13 years ago

The only way to really get around this is to specify a branch in the clone, or fetch everything and checkout the right version.

Either way I'd need to change the install script every time and this would mean everyone constantly has to re-run the one-liner.

Can we leave the working branch as it is?

Kindari commented 13 years ago

Tagging onto this post because it is related - It would be nice to optionally specify a branch. oil create app 1.1/develop

philsturgeon commented 13 years ago

Now that we can do and I'll tack it onto the final decision. We might have to write a change.

ONE solution is to look somewhere online to see what the current branch should be, which could be a text-file on the server or something silly?

default_branch = {go and find something with curl}
BRANCH=${2:-$default_branch }
chadhutchins commented 13 years ago

Utilizing the GitHub Developer API may be beneficial to get the repo's current default branch. Search for "master_branch" in the "Get" method: http://developer.github.com/v3/repos/#get

philsturgeon commented 13 years ago

@chadhutchins: The problem there is that the "master branch" is actually 1.1/develop. We've change the default branch and so this API request will show the exact same thing, meaning a whole bunch of code for the same result >.<

WanWizard commented 12 years ago

@philsturgeon any more thoughts on this?

We only need to know the latest release version. Can't we get it from the website? The branch itself should always be "/master".

philsturgeon commented 12 years ago

Yeah I was thinking of a revised bash script that would look at a text-file on the server, just kept forgetting to actually do it:

#!/bin/bash

if [ -f "./oil" ]; then
        php oil "$@"
else

        if [ "$1" == "create" ]; then

                if [ ! `which git` ]; then 
                    echo "For this installer to work you'll need to install Git."
                    echo '        http://git-scm.com/'
                fi

                current_version=`curl http://fuelphp.com/current-version`

                git clone --recursive git://github.com/fuel/fuel.git "./$2" -b "$current_version/master"
                php "./$2/oil" refine install
        else
                echo 'This is not a valid Fuel installation so Oil is a bit lost.'
                echo '        http://fuelphp.com/docs/installation/instructions.html'

        fi
fi

That should do the trick.

WanWizard commented 12 years ago

Any more feedback on this @philsturgeon? I'd like to close this for the 1.2 RC.

philsturgeon commented 12 years ago

I thought this had already be done tbh.

I'll finish this up tonight, as I've already written the damn code - just need to test and commit.

philsturgeon commented 12 years ago

Closed and ready! I've updated the oil installer, so you'll need to re-run the one-liner.