-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathghcs-interactive.sh
39 lines (32 loc) · 926 Bytes
/
ghcs-interactive.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Detect the current shell
current_shell=$(ps -p $$ -ocomm=)
# Source the appropriate function file based on the detected shell
case "$current_shell" in
*fish)
source gh-copilot.fish
ghcs_interactive_option # Execute the function after sourcing in Fish shell
;;
*bash)
source gh-copilot.bash
ghcs_interactive_option # Execute the function in Bash shell
;;
*zsh)
source gh-copilot.zsh
ghcs_interactive_option # Execute the function in Zsh shell
;;
*)
echo "Unsupported shell: $current_shell"
exit 1
;;
esac
# fish
# function ghcs_interactive_option
# functions ghcs | sed "s/ \-t \"\$TARGET\"//" | source
# end
# bash
# eval "$(declare -f ghcs | sed 's/ -t "\$TARGET"//')"
#zsh
# function ghcs_interactive_option {
# functions ghcs | sed 's/ -t "\$TARGET"//' | source /dev/stdin
# }