'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 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cyberience