First of all, since the syntax of fish is different from zsh, you also need to change the output clone_git_fileto source.
For example, if clone_git_fileit looks something like this:
#!/bin/bash
echo "FOO=$TARGET_DIRECTORY"
echo "BAR=$2"
you need to change it to fish syntax.
#!/bin/bash
echo "set -gx FOO $TARGET_DIRECTORY"
echo "set -gx BAR $2"
Now here is the function ogf()and sample code for the fish:
function ogf
echo "Cloning, your editor will open when clone has completed..."
source (env TARGET_DIRECTORY=~/students EDITOR=$EDITOR clone_git_file -ts $argv[1] | psub)
end
ogf MY_ARGUMENT
echo "FOO is $FOO"
echo "BAR is $BAR"
Running this code with fish:
FOO is /home/MY_USER/students
BAR is MY_ARGUMENT
source
share