# shellcheck shell=dash

___X_CMD_FISH_SETUP_RCCODE='test ! -e "$HOME/.x-cmd.root/local/data/fish/rc.fish" || source "$HOME/.x-cmd.root/local/data/fish/rc.fish" # boot up x-cmd.'

___x_cmd_fish___setup(){
    local rcfp="$HOME/.x-cmd.root/local/data/fish/rc.fish"
    ___x_cmd ensurefp "$rcfp"
    ___x_cmd cp -f  "$___X_CMD_ROOT_MOD/fish/lib/rc/rc.fish"    "$rcfp"

    ___x_cmd boot initrcfile1 "$___X_CMD_FISH_SETUP_RCCODE"     "$HOME/.config/fish/config.fish" || return 1
    ___x_cmd shortcut compile fish
}

___x_cmd_fish___setup_is_required(){
    ! {
        ___x_cmd boot ensurerccodewithoutextra  \
                                "$___X_CMD_FISH_SETUP_RCCODE"               "$HOME/.config/fish/config.fish"    && \
            ___x_cmd_cmds cmp   "$___X_CMD_ROOT_MOD/fish/lib/rc/rc.fish"    "$HOME/.x-cmd.root/local/data/fish/rc.fish"
    } 1>/dev/null 2>/dev/null
}
