potiuk opened a new issue #21163:
URL: https://github.com/apache/airflow/issues/21163


   ### Apache Airflow version
   
   main (development)
   
   ### What happened
   
   When I run "setup-autocomplete" in the new Breeze with zsh it fails with 
"permission denied" as it tries to access `/.zshrc`:
   
   ```
   Installing zsh completion for local user
   Activation command scripts are created in this autocompletion path: 
/home/jarek/code/airflow/.build/autocomplete/Breeze2-complete.zsh
   Do you want to add the above autocompletion scripts to your zsh profile? 
[y/N]: y
   This will modify the /.zshrc file
   Traceback (most recent call last):
     File "/home/jarek/code/airflow/.build/breeze2/venv/bin/Breeze2", line 33, 
in <module>
       sys.exit(load_entry_point('apache-airflow-breeze', 'console_scripts', 
'Breeze2')())
     File 
"/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py",
 line 1128, in __call__
       return self.main(*args, **kwargs)
     File 
"/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py",
 line 1053, in main
       rv = self.invoke(ctx)
     File 
"/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py",
 line 1659, in invoke
       return _process_result(sub_ctx.command.invoke(sub_ctx))
     File 
"/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py",
 line 1395, in invoke
       return ctx.invoke(self.callback, **ctx.params)
     File 
"/home/jarek/code/airflow/.build/breeze2/venv/lib/python3.8/site-packages/click/core.py",
 line 754, in invoke
       return __callback(*args, **kwargs)
     File "/home/jarek/code/airflow/dev/breeze/src/airflow_breeze/breeze.py", 
line 248, in setup_autocomplete
       write_to_shell(command_to_execute, script_path, breeze_comment)
     File "/home/jarek/code/airflow/dev/breeze/src/airflow_breeze/breeze.py", 
line 215, in write_to_shell
       with open(script_path, 'a') as script_file:
   PermissionError: [Errno 13] Permission denied: '/.zshrc'
   [jarek:~/code/airflow] static-check-breeze2+ 6s 1 ± 
   ```
   
   ### What you expected to happen
   
   I expected the scripts in my `${HOME}` directory to be updated with 
auto-complete but apparently it tries to update a file in `root' folder. 
   
   ### How to reproduce
   
   * Have zsh as your shell
   * Run `./Breeze2 setup-autocomplete`
   
   ### Operating System
   
   Linux Mint 20.1.3 
   
   ### Versions of Apache Airflow Providers
   
   - Not relevant -
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   No airflow - this is just a development environment.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to