From 3dbcbcbe34ed4869e23ee0bc153a98b5e4bfb46b Mon Sep 17 00:00:00 2001 From: wushuiyong Date: Tue, 19 Jan 2016 13:53:59 +0800 Subject: [PATCH] clone project => cp project & update --- components/Folder.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/Folder.php b/components/Folder.php index eb128db3..3e49ca12 100644 --- a/components/Folder.php +++ b/components/Folder.php @@ -19,10 +19,15 @@ class Folder extends Command { * @return bool */ public function initLocalWorkspace($version) { - $cmd[] = 'mkdir -p ' . Project::getDeployWorkspace($version); + // svn if ($this->config->repo_type == Project::REPO_SVN) { + $cmd[] = 'mkdir -p ' . Project::getDeployWorkspace($version); $cmd[] = sprintf('mkdir -p %s-svn', rtrim(Project::getDeployWorkspace($version), '/')); } + // git 直接把项目代码拷贝过来,然后更新,取代之前原项目检出,提速 + else { + $cmd[] = sprintf('cp -rf %s %s ', Project::getDeployFromDir(), Project::getDeployWorkspace($version)); + } $command = join(' && ', $cmd); return $this->runLocalCommand($command); }