Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Oil crashing on me using Git Bash
  • Not sure if this will run on windows.

    Windows 7 Pro (64-bit) Git Bash

    $ curl get.fuelphp.com/oil | sh

    C:\Program Files (x86)\Git\bin\oil - The file is there.

    $ oil create htdocs/blog - All of FuelPHP is in this blog directory.

    Runs through everything fine until it hits this error in the end!

    Writing lock file
    Generating autoload files
    Could not open input file: ./htdocs/blog/oil
    Ray@RAYS /c/xampp
    $

  • NOTE: This is not the oil in the fuel directory but the one downloaded with Git Bash 
    $ curl get.fuelphp.com/oil | sh !

    I modified the oil file that was downloaded through Git Bash to the below and it now works fine.

    #!/bin/bash

    # if we have the oil script in the current directory, start that
    if [ -f "./oil" ]; then
            php oil "$@"
    else

    # check for bash commandline options
            if [ "$1" == "create" ]; then

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

    # clone the repository, and make sure the latest master is active
                    git clone --recursive git://github.com/fuel/fuel.git "./$2"
                    cd ./$2
                    branch=`git branch -a | grep -v "remote" | grep "master" | tail -1`
                    branch=${branch#* }
                    git checkout $branch
                    git submodule foreach git checkout $branch

                    # run composer
                    php composer.phar self-update
                    php composer.phar update

                    # fix potential rights issues
                    cd ..

    # Changed the below

                    #php "./$2/oil" refine install
                    
                    # Works now on Windows 7 Pro (64-bit) maybe need a check
                    # to see if it is a Windows System?
                    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
    --------------------------------------------------------------------------------------------------------------

    It needed two dots .. in front not one .
  • HarroHarro
    Accepted Answer
    That should be a single dot, a double dot meant "one directory up"

    if you start in "C:\here", and you create a new install called "new", it will create "C:\here\new" and install it there. it then does a "cd ./$2' to fo into the "new" directory, and runs a "git branch". when done it does a "cd .." to go back to "C:\here".

    So "./$2/oil" should translate to "C:\here\new\oil", which is correct.

    So where does the script go wrong in git bash?
  • It cannot open the oil input file

    Generating autoload files
    Could not open input file: ./htdocs/blog/oil

    in bash I do a cd /c/xampp

    so I am now in the xampp directory

    then I do this:

    oil create htdocs/blog

    It fails on opening the oil input file from the blog directory after I added the ../ it worked with no errors
    and I was able to run the program.


  • I put it back to the original and it works if I do it like this:

    $ cd /c/xampp/htdocs

    then

    $ oil create blog

    This throws the error:

    $cd /c/xampp

    $ oil create htdocs/blog

    so it looks like I need to be in the htdocs directory for it to work right.

    Sorry for taking up your time.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion