File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def read_token():
2929 print (f"{ Fore .RED } ✕{ Fore .RESET } Error reading Token:\n { Fore .RED } { e } { Fore .RESET } " )
3030 return "error"
3131
32- def set_token (token , yes = False ):
32+ def set_token (token : str , yes = False ):
3333 # 凭据 github-access-token.glm
3434 # == 移除 ==
3535 if token == "remove" :
@@ -49,7 +49,7 @@ def set_token(token, yes=False):
4949
5050 # == 添加 ==
5151 # --- Token 检查 ---
52- if not (token .startswith ("ghp_" ) and token .startwith ("github_pat_" ) and yes ):
52+ if not (token .startswith ("ghp_" ) or token .startswith ("github_pat_" ) or yes ):
5353 print (f"{ Fore .YELLOW } ⚠{ Fore .RESET } Please check whether the Token is correct." )
5454 try :
5555 input (f"Press { Fore .BLUE } Enter{ Fore .RESET } to confirm, press { Fore .BLUE } Ctrl + C{ Fore .RESET } to cancel..." )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def read_token():
2929 print (f"{ Fore .RED } ✕{ Fore .RESET } 读取Token时出错:\n { Fore .RED } { e } { Fore .RESET } " )
3030 return "error"
3131
32- def set_token (token , yes = False ):
32+ def set_token (token : str , yes = False ):
3333 # 凭据 github-access-token.glm
3434 # == 移除 ==
3535 if token == "remove" :
@@ -49,7 +49,7 @@ def set_token(token, yes=False):
4949
5050 # == 添加 ==
5151 # --- Token 检查 ---
52- if not (token .startswith ("ghp_" ) and token .startwith ("github_pat_" ) and yes ):
52+ if not (token .startswith ("ghp_" ) or token .startswith ("github_pat_" ) or yes ):
5353 print (f"{ Fore .YELLOW } ⚠{ Fore .RESET } 请确认Token是否正确" )
5454 try :
5555 input (f"按{ Fore .BLUE } Enter{ Fore .RESET } 键确认,按{ Fore .BLUE } Ctrl + C{ Fore .RESET } 键取消..." )
You can’t perform that action at this time.
0 commit comments