Explorar el Código

walle 2.0 alpha - fix 可能webroot不存在

walle hace 6 años
padre
commit
463c5dabb3
Se han modificado 2 ficheros con 3 adiciones y 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)