Skip to content

Commit

Permalink
feat: 显示安装目录 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckDuckStudio authored Sep 10, 2024
1 parent 5fe8df4 commit 4ba7ea9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ cython_debug/
#.idea/

# 开发清单
软著/

# Debug
labels.json
Expand Down
8 changes: 5 additions & 3 deletions other-languages/en_US/glm-en_US.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def get_labels(url, save):
output += ".json"

if os.path.exists(output):
print(f"{Fore.RED}{Fore.RESET} The save location is being occupied!")
return "cancel"# 返回取消状态
print(f"{Fore.YELLOW}{Fore.RESET} The save location is occupied! Whether to overwrite it? [Y/N]")
if input(f"{Fore.BLUE}?{Fore.RESET} [Y] Confirm [N] Cancel: ").lower() not in ["是", "覆盖", "overwrite", "y", "yes"]:
print(f"{Fore.BLUE}[!]{Fore.RESET} Cancelled operation.")
return "cancel"# 返回取消状态

print(f"\r{Fore.GREEN}{Fore.RESET} The save location has been selected: {Fore.BLUE}{output}{Fore.RESET}")
# ------------
Expand Down Expand Up @@ -382,7 +384,7 @@ def main():
except Exception as e:
print(f"{Fore.RED}{Fore.RESET} Unable to open the configuration file: {Fore.RED}{e}{Fore.RESET}\n{Fore.BLUE}[!]{Fore.RESET} Please confirm that the configuration file path is correct: {Fore.BLUE}{config_path}{Fore.RESET}")
elif args.version:
print(f"{Fore.GREEN}{Fore.RESET} The current version is:\nGitHub Labels Manager v{Fore.BLUE}{version}{Fore.RESET}")
print(f"{Fore.GREEN}{Fore.RESET} The current version is:\nGitHub Labels Manager v{Fore.BLUE}{version}{Fore.RESET}\nInstalled in: {Fore.BLUE}{script_path}{Fore.RESET}")
else:
print(f"{Fore.RED}{Fore.RESET} Missing configuration item.")
return 1, running_result
Expand Down
8 changes: 5 additions & 3 deletions 程序脚本/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ def get_labels(url, save):
output += ".json"

if os.path.exists(output):
print(f"{Fore.RED}{Fore.RESET} 保存位置已被占用!")
return "cancel"# 返回取消状态
print(f"{Fore.YELLOW}{Fore.RESET} 保存位置已被占用!是否覆盖 [Y/N]")
if input(f"{Fore.BLUE}?{Fore.RESET} [Y] 覆盖 [N] 取消: ").lower() not in ["是", "覆盖", "y", "yes"]:
print(f"{Fore.BLUE}[!]{Fore.RESET} 已取消操作")
return "cancel"# 返回取消状态

print(f"\r{Fore.GREEN}{Fore.RESET} 已选择保存位置: {Fore.BLUE}{output}{Fore.RESET}")
# ------------
Expand Down Expand Up @@ -382,7 +384,7 @@ def main():
except Exception as e:
print(f"{Fore.RED}{Fore.RESET} 无法打开配置文件: {Fore.RED}{e}{Fore.RESET}\n{Fore.BLUE}[!]{Fore.RESET} 请确认配置文件路径正确: {Fore.BLUE}{config_path}{Fore.RESET}")
elif args.version:
print(f"{Fore.GREEN}{Fore.RESET} 当前使用的版本为:\nGitHub Labels Manager v{Fore.BLUE}{version}{Fore.RESET}")
print(f"{Fore.GREEN}{Fore.RESET} 当前使用的版本为:\nGitHub Labels Manager v{Fore.BLUE}{version}{Fore.RESET}\n安装在: {Fore.BLUE}{script_path}{Fore.RESET}")
else:
print(f"{Fore.RED}{Fore.RESET} 缺少配置项")
return 1, running_result
Expand Down

0 comments on commit 4ba7ea9

Please sign in to comment.