Skip to content

Commit 8ac7d01

Browse files
committed
Add compatibility for Linux and MacOS
1 parent d8eff8e commit 8ac7d01

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

settings.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
# 路径结尾的斜杠不能省略
66
# ending slash in folders can NOT be omitted
77

8-
# BASE_PATH 是工作目录
9-
# BASE_PATH is the working directory
10-
# BASE_FOLDER = '/home/nate/soft/trilium/trilium-trans/'
11-
BASE_FOLDER = '/Users/nate/soft/trilium/trilium-trans/'
8+
import platform
129

13-
# PATCH_FOLDER 是输出补丁的目录
14-
# PATCH_FOLDER is the output for patch
15-
# PATCH_FOLDER = '/home/nate/soft/trilium/trilium-trans-patch/'
16-
PATCH_FOLDER = '/Users/nate/soft/trilium/trilium-trans-patch/'
10+
if platform.system() == 'Linux':
11+
# BASE_PATH 是工作目录
12+
# BASE_PATH is the working directory
13+
BASE_FOLDER = '/home/nate/soft/trilium/trilium-trans/'
14+
15+
# PATCH_FOLDER 是输出补丁的目录
16+
# PATCH_FOLDER is the output for patch
17+
PATCH_FOLDER = '/home/nate/soft/trilium/trilium-trans-patch/'
18+
19+
# TRANS_RELEASE_FOLDER 是翻译好的客户端发布的路径
20+
# TRANS_RELEASE_FOLDER is the release directory for translated clients
21+
TRANS_RELEASE_FOLDER = '/home/nate/soft/trilium/trilium-trans-release/'
22+
else:
23+
# MacOS
24+
BASE_FOLDER = '/Users/nate/soft/trilium/trilium-trans/'
25+
PATCH_FOLDER = '/Users/nate/soft/trilium/trilium-trans-patch/'
26+
TRANS_RELEASE_FOLDER = '/Users/nate/soft/trilium/trilium-trans-release/'
1727

18-
# TRANS_RELEASE_FOLDER 是翻译好的客户端发布的路径
19-
# TRANS_RELEASE_FOLDER is the release directory for translated clients
20-
# TRANS_RELEASE_FOLDER = '/home/nate/soft/trilium/trilium-trans-release/'
21-
TRANS_RELEASE_FOLDER = '/Users/nate/soft/trilium/trilium-trans-release/'
2228

2329
# release文件名后缀
2430
# release file name suffix
@@ -31,8 +37,8 @@
3137

3238
# 连不到GitHub需要设置代理 USE_PROXY=False 不会用代理
3339
# Change following proxy setting if you need proxy to connect to GitHub. set USE_PROXY=False can ignore it.
34-
USE_PROXY = True
35-
# USE_PROXY = False
40+
# USE_PROXY = True
41+
USE_PROXY = False
3642
PROXIES = {
3743
"http": "socks5://127.0.0.1:10808",
3844
"https": "socks5://127.0.0.1:10808"

0 commit comments

Comments
 (0)