pocketarc / git-deploy-php

git-deploy-php is a simple php-based tool that deploys your Git repositories to FTP/SFTP servers, and keeps them updated automatically.
http://brunodebarros.github.io/git-deploy-php
291 stars 45 forks source link

Broken options if specified custom .ini file #22

Closed Ciki closed 11 years ago

Ciki commented 11 years ago

On https://github.com/BrunoDeBarros/git-deploy-php#list-files-to-upload-and-delete there is php git-deploy [your_ini_file_name] -l but I think this is not going to work with provided custom .ini file.

From php.net/getopt The parsing of options will end at the first non-option found, anything that follows is discarded.

The solution is to use option for specifying custom ini file

pocketarc commented 11 years ago

Definitely, I agree with you. I think it's just a matter of doing php git-deploy -l [your_ini_file_name]. I'll correct the readme as soon as I can.

Your commit for using --env seems great, but I can't merge it because it brings with it some baggage from the changes you've made (which themselves have not yet been merged either). I really need to take a few hours to sort that out and merge your stuff onto the main repository.

Ciki commented 11 years ago

IMO switching arguments does not help because you are checking for $argv[1] if there is custom .ini file provided. As all switches (options) are optional you can't just change index 1 neither. That's why I used --env. (Sure you can also use number of given options to get the right index).

I planned to do pull request for this but now I am short on time as well..

pocketarc commented 11 years ago

Hi Ciki, I've also fixed this for 2.0; the deploy file will now be the last argument passed to the script, and there'll be a -d arg to specify a deploy file, if you want to be more proper.