mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
refactor: remove --set-env argument processing from main function
This commit is contained in:
parent
b3305e6e19
commit
2492f1635c
1 changed files with 0 additions and 11 deletions
|
@ -454,17 +454,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
# Load the .env file specified in the arguments
|
# Load the .env file specified in the arguments
|
||||||
loaded_dotenvs = load_dotenv_files(git_root, args.env_file, args.encoding)
|
loaded_dotenvs = load_dotenv_files(git_root, args.env_file, args.encoding)
|
||||||
|
|
||||||
# Process any environment variables set via --set-env
|
|
||||||
if args.set_env:
|
|
||||||
for env_setting in args.set_env:
|
|
||||||
try:
|
|
||||||
name, value = env_setting.split("=", 1)
|
|
||||||
os.environ[name.strip()] = value.strip()
|
|
||||||
except ValueError:
|
|
||||||
io.tool_error(f"Invalid --set-env format: {env_setting}")
|
|
||||||
io.tool_output("Format should be: ENV_VAR_NAME=value")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
# Parse again to include any arguments that might have been defined in .env
|
# Parse again to include any arguments that might have been defined in .env
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue