|
@@ -38,12 +38,12 @@ fgh curl -O https://ghproxy.org/https://raw.githubusercontent.com/microsoft/vsco
|
|
|
def __init__(self):
|
|
|
self.fgit_host = ''
|
|
|
self.token = ''
|
|
|
+ self.sess = requests.Session()
|
|
|
+ self.env_file_path = os.path.join(get_app_path(), '.env')
|
|
|
self.update_host()
|
|
|
self.read_config()
|
|
|
self.args = self.parse_args()
|
|
|
- self.sess = requests.Session()
|
|
|
- self.env_file_path = os.path.join(get_app_path(), '.env')
|
|
|
-
|
|
|
+
|
|
|
def read_config(self):
|
|
|
""" read config """
|
|
|
current_dir = get_app_path()
|
|
@@ -93,7 +93,7 @@ fgh curl -O https://ghproxy.org/https://raw.githubusercontent.com/microsoft/vsco
|
|
|
"""update host"""
|
|
|
res = []
|
|
|
try:
|
|
|
- res = self.sess.get(self.fgit_host+'/update_host')
|
|
|
+ res = self.sess.get('https://git.yoqi.me/lyq/fgh/raw/master/docs/fgh_host.json')
|
|
|
fgh_hosts= res.json()["hosts"]
|
|
|
fgh_host= self._get_best_host()
|
|
|
dotenv.set_key(self.env_file_path, 'FGH_HOST', fgh_host)
|