简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM