Commit d2c2c155cd
Unsigned
Layout: unified · split
curd.py +14 −1
| @@ -868,6 +868,19 @@ def create_default_user_config(default_config): | |||
| 868 | 868 | ||
| 869 | return output_string | 869 | return output_string |
| 870 | 870 | ||
| 871 | def get_config_file_path(): | ||
| 872 | command = """echo $HOME""" | ||
| 873 | |||
| 874 | result = subprocess.run(command, shell=True, capture_output=True, text=True) | ||
| 875 | output = result.stdout.strip() | ||
| 876 | |||
| 877 | folder_name = f"{output}/.config/curd" | ||
| 878 | file_name = "curd.conf" | ||
| 879 | |||
| 880 | config_file_path = os.path.join(folder_name, file_name) | ||
| 881 | |||
| 882 | return config_file_path | ||
| 883 | |||
| 871 | def load_config() -> dict: | 884 | def load_config() -> dict: |
| 872 | command = """echo $HOME""" | 885 | command = """echo $HOME""" |
| 873 | 886 | ||
| @@ -1171,7 +1184,7 @@ try: | |||
| 1171 | access_token_path = os.path.join(history_file_path_, "token") | 1184 | access_token_path = os.path.join(history_file_path_, "token") |
| 1172 | 1185 | ||
| 1173 | if args.e: | 1186 | if args.e: |
| 1174 | os.system("vim "+get_userconfig_value(user_config, "history_file")) | 1187 | os.system("vim "+get_config_file_path()) |
| 1175 | print("updated config.") | 1188 | print("updated config.") |
| 1176 | exit(0) | 1189 | exit(0) |
| 1177 | 1190 | ||