简体   繁体   English

Capistrano命令

[英]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 的Linux版本是

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

The aim is to zip a selection of folders and files, and exclude the ./version folder. 目的是压缩所选的文件夹和文件,并排除./version文件夹。 in the linux command line, it works fine, but through the Capistrano, the version folder is always there. 在linux命令行中,它可以正常工作,但是通过Capistrano,版本文件夹始终存在。 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: 答案很简单,但是可以吸引您,需要在两行之间阅读,-x后应该没有空格,因此,正确的答案如下:

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. 我现在感觉很愚蠢,但对于有类似或其他问题的人来说可能是一个很好的指示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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