rubyzipcapistrano3

Capistrano commands


Can anyone tell me why the following command will not work.

execute :zip, :'-r', './version/files/fullsite.zip', :'.',:' -x', :'./version/*'

The linux version of this is

zip -r ./version/files/fullsite.zip . -x./version/\*

The aim is to zip a selection of folders and files, and exclude the ./version folder. in the linux command line, it works fine, but through the Capistrano, the version folder is always there. I also tried the following:

execute :zip, :'-r', './version/files/fullsite.zip . -x ./version/\*'

and

execute :zip, :'-r', './version/files/fullsite.zip . -x ./version/*'

which also does not exclude the version folder.


Solution

  • The answer is quiet simple, but can catch you out, needing to read between the lines, there should be no space after the -x so infact the correct answer to this is as follows:

    execute :zip, :'-r', './version/files/fullsite.zip . -x./version/*'
    

    Also works

    execute :zip, :'-r', './version/files/fullsite.zip . -x ./version/\*'
    

    And so does this

    execute :zip, :'-r', './version/files/fullsite.zip', :'.',:' -x./version/*'
    

    I feel so dumb now, but might be good indicator for people with the same or other problems like this.