liuyuqi-dellpc 1 year ago
parent
commit
ff917f9d10
2 changed files with 3 additions and 3 deletions
  1. 1 1
      client.py
  2. 2 2
      fgh/config.py

+ 1 - 1
client.py

@@ -32,7 +32,7 @@ fgh curl -O https://ghproxy.org/https://raw.githubusercontent.com/microsoft/vsco
 
     def read_config(self):
         import dotenv
-        current_dir = os.path.dirname(os.path.realpath(__file__))
+        current_dir = os.path.dirname(sys.executable)
         dotenv.load_dotenv(os.path.join(current_dir, '.env'))
         fgit_host = os.getenv('FGH_HOST')
         try:

+ 2 - 2
fgh/config.py

@@ -7,11 +7,11 @@
 @Desc    :   config
 """
 
-import os
+import os, sys
 from dotenv import load_dotenv
 
 if os.path.exists('.env'):
-    app_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+    app_path = os.path.dirname(os.path.dirname(sys.executable))
     load_dotenv(os.path.join(app_path, '.env'), verbose=True)
 
 class BaseConfig: