瀏覽代碼

doc: handle release definition when not being in a git repository

Frédéric Pierret 6 年之前
父節點
當前提交
9fe403e3c7
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      doc/conf.py

+ 4 - 1
doc/conf.py

@@ -74,7 +74,10 @@ author = 'Invisible Things Lab'
 # The short X.Y version.
 version = open('../version').read().strip()
 # The full version, including alpha/beta/rc tags.
-release = subprocess.check_output(['git', 'describe', '--long', '--dirty']).strip().decode()
+try:
+    release = subprocess.check_output(['git', 'describe', '--long', '--dirty']).strip().decode()
+except:
+    release = "1"
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.