{"action":"opened","issue":{"url":"https://api.github.com/repos/fex-team/fis-command-release/issues/8","labels_url":"https://api.github.com/repos/fex-team/fis-command-release/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/fis-command-release/issues/8/comments","events_url":"https://api.github.com/repos/fex-team/fis-command-release/issues/8/events","html_url":"https://github.com/fex-team/fis-command-release/issues/8","id":57723701,"number":8,"title":"多次读取项目配置的文本文件会造成crash","user":{"login":"yanni4night","id":1710436,"avatar_url":"https://avatars.githubusercontent.com/u/1710436?v=3","gravatar_id":"","url":"https://api.github.com/users/yanni4night","html_url":"https://github.com/yanni4night","followers_url":"https://api.github.com/users/yanni4night/followers","following_url":"https://api.github.com/users/yanni4night/following{/other_user}","gists_url":"https://api.github.com/users/yanni4night/gists{/gist_id}","starred_url":"https://api.github.com/users/yanni4night/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanni4night/subscriptions","organizations_url":"https://api.github.com/users/yanni4night/orgs","repos_url":"https://api.github.com/users/yanni4night/repos","events_url":"https://api.github.com/users/yanni4night/events{/privacy}","received_events_url":"https://api.github.com/users/yanni4night/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-15T09:04:31Z","updated_at":"2015-02-15T09:04:31Z","closed_at":null,"body":"[第86行](https://github.com/fex-team/fis-command-release/blob/a4653b8894dcedaa2ad1b74d8a22c7088ef57931/lib/deploy.js#L86) 这里是不是要转成字符串呢，因为 `fis.util.toEncoding()` 返回的是 `Buffer`对象，而这片代码是在 _file.isText()_ 分支下的。\r\n\r\n遇到过在新机器上部署 `fis` ，有些文本文件是被 `fis` 多次读取的，一个文本文件的 _content_ 一旦被设置为 `Buffer` 对象后，下次读取可能会假设其为 `String` 而直接调用 _replace_ 方法最终 crash。\r\n\r\n\r\n```\r\n/usr/local/lib/node_modules/fis/node_modules/fis-command-release/lib/deploy.js:65\r\n                content = content.replace(reg, dest.replace.to);\r\n                                  ^\r\nTypeError: Object <?\r\n$this->display(\"activity_head/activity_head.php\");\r\n?>\r\n has no method 'replace'\r\n    at prepareDeploy (/usr/local/lib/node_modules/fis/node_modules/fis-command-release/lib/deploy.js:65:35)\r\n```"}}