Bowrna commented on pull request #20066:
URL: https://github.com/apache/airflow/pull/20066#issuecomment-992123937


   @potiuk with click-completion it can generate all the shell files (zsh, 
bash, fish, powershell). But generating in pre-commit fails with below message:
   ```
   File "pre_commit_breeze_generate_autocomplete_scripts.py", line 50, in 
<module>
       generate_autocompletion_script(shell_type)
     File "pre_commit_breeze_generate_autocomplete_scripts.py", line 41, in 
generate_autocompletion_script
       shell, path = click_completion.core.install(shell=shell, 
prog_name='Breeze2',path=autocomplete_path,
     File 
"/Users/sathishkannan/.pyenv/versions/airflow-env/lib/python3.8/site-packages/click_completion/core.py",
 line 351, in install
       subprocess.check_call(['powershell', 'Set-ExecutionPolicy Unrestricted 
-Scope CurrentUser'])
     File 
"/Users/sathishkannan/.pyenv/versions/3.8.10/lib/python3.8/subprocess.py", line 
359, in check_call
       retcode = call(*popenargs, **kwargs)
     File 
"/Users/sathishkannan/.pyenv/versions/3.8.10/lib/python3.8/subprocess.py", line 
340, in call
       with Popen(*popenargs, **kwargs) as p:
     File 
"/Users/sathishkannan/.pyenv/versions/3.8.10/lib/python3.8/subprocess.py", line 
858, in __init__
       self._execute_child(args, executable, preexec_fn, close_fds,
     File 
"/Users/sathishkannan/.pyenv/versions/3.8.10/lib/python3.8/subprocess.py", line 
1704, in _execute_child
       raise child_exception_type(errno_num, err_msg, err_filename)
   FileNotFoundError: [Errno 2] No such file or directory: 'powershell'
   ```
   It says no powershell. I am working on macOS. With this,
   1.)  do we need to generate all the script files in pre-commit and add them 
as part of the repository? It may fail like this depending upon the shell 
right. 
   2) Could we generate the script file on the fly when running `Breeze2 
setup-autocomplete`? This will generate the script file and update that to 
right shell like `.bashrc/.zshrc/fish commands/powershell`. If we are doing it 
this way, then we don't need to generate any script in advance in .pre-commit. 
Am i right in thinking this way?
   
   


-- 
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