|
1 |
| -from os import path |
| 1 | +from os import environ, path |
2 | 2 |
|
3 | 3 | class App():
|
4 |
| - name = "Rel1cStyle RIG" |
| 4 | + NAME = "Rel1cStyle RIG" |
5 | 5 |
|
6 |
| - version = "0.2" |
| 6 | + VERSION = "0.2.2" |
7 | 7 |
|
8 |
| - api_url = "https://rig-api-thunder.rel1c.work" |
| 8 | + #API_URL = "https://api.rig.rel1c.work" |
| 9 | + API_URL = "https://rig-api-thunder.rel1c.work" |
| 10 | + #preview_image_url = "https://rig-r2-images.huerisalter.com" |
| 11 | + |
| 12 | + COMMIT_SHA = "" |
| 13 | + BRANCH = "" |
| 14 | + ENV = "" |
9 | 15 |
|
10 | 16 | if path.isfile("_commit_sha.txt"):
|
11 |
| - with open("_commit_sha.txt", mode="r") as f: |
12 |
| - commit_sha = f.read()[0:7] |
13 |
| - commit_sha = commit_sha.replace("\n", "") |
| 17 | + with open("_commit_sha.txt", mode="r", encoding="utf-8") as f: |
| 18 | + COMMIT_SHA = f.read()[0:7].replace("\n", "") |
14 | 19 | else:
|
15 |
| - commit_sha = "0" |
| 20 | + COMMIT_SHA = "0" |
16 | 21 |
|
17 | 22 | if path.isfile("_branch_name.txt"):
|
18 |
| - with open("_branch_name.txt", mode="r") as f: |
19 |
| - branch = f.read() |
20 |
| - branch = branch.replace("\n", "") |
| 23 | + with open("_branch_name.txt", mode="r", encoding="utf-8") as f: |
| 24 | + BRANCH = f.read().replace("\n", "") |
| 25 | + else: |
| 26 | + BRANCH = "dev" |
| 27 | + |
| 28 | + if path.isfile("_env_name.txt"): |
| 29 | + with open("_env_name.txt", mode="r", encoding="utf-8") as f: |
| 30 | + ENV = f.read().replace("\n", "") |
21 | 31 | else:
|
22 |
| - branch = "dev" |
| 32 | + ENV = "UNKNOWN" |
0 commit comments