Explorar o código

walle 2.0 alpha - fix 可能webroot不存在

walle %!s(int64=6) %!d(string=hai) anos
pai
achega
463c5dabb3
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      README.md
  2. 2 2
      walle/service/deployer.py

+ 1 - 1
README.md

@@ -23,7 +23,7 @@ Preview
 =========================
 ![](https://raw.github.com/meolu/walle-web/master/screenshot/projects.png)
 ![](https://raw.github.com/meolu/walle-web/master/screenshot/deploy.png)
-![](https://raw.github.com/meolu/walle-web/master/walle-web.io/docs/2/zh-cn/static/deploy-console.png)
+![](https://raw.github.com/meolu/docs/master/walle-web.io/docs/2/zh-cn/static/deploy-console.png)
 
 Installation
 =========================

+ 2 - 2
walle/service/deployer.py

@@ -236,7 +236,7 @@ class Deployer:
 
         with waller.cd(self.project_info['target_releases']):
             # 0. get previous link
-            command = 'readlink ' + self.project_info['target_root']
+            command = '[ -L %s ] && readlink %s || echo ""' % (self.project_info['target_root'], self.project_info['target_root'])
             result = waller.run(command, wenv=self.config(console=False))
             self.previous_release_version = os.path.basename(result.stdout).strip()
 
@@ -264,7 +264,7 @@ class Deployer:
 
         with waller.cd(self.project_info['target_releases']):
             # 0. get previous link
-            command = 'readlink ' + self.project_info['target_root']
+            command = '[ -L %s ] && readlink %s || echo ""' % (self.project_info['target_root'], self.project_info['target_root'])
             result = waller.run(command, wenv=self.config(console=False))
             self.previous_release_version = os.path.basename(result.stdout)