URL as a Command
When I enter a git repo url in terminal it says:
Code:
% https://github.com/chmln/sd.git Code:
git clone https://github.com/chmln/sd.git |
I tried preexec hook.
Code:
preexec () { Code:
% https://github.com/chmln/sd.git |
The code that is working is
Code:
preexec () { Code:
% https://github.com/chmln/sd.git |
I got a solution where it uses
Code:
function command_not_found_handle { I am guessing this because, I used Code:
if [[ -x /usr/lib/command-not-found ]] ; then |
Code:
function _accept-line-with-url { |
Quote:
The shell is always going to report "no such file" for a URL unless you have an actual file named sd.gin in a directory named chmln in a directory named github.com in a directory named https: Something like this in a file name rungit: Code:
#!/bin/zsh Code:
rungit https://github.com/chmln/sd.git |
Use the code in my last post and put it in your .zshrc
Alhamdulillah, it is actually working now. |
All times are GMT -5. The time now is 07:09 AM. |