summary refs log tree commit diff
path: root/pkgs/applications/editors/vim/plugins/vim-gen-doc-hook.sh
blob: d5f0a00ebcc280754734e989ac6c5f326895c911 (plain) (blame)
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
echo "Sourcing vim-gen-doc-hook"

# the doc folder is copied via the copy_directories entry of the rockspec
# in the folder gitsigns.nvim-scm-1-rocks/gitsigns.nvim/scm-1
vimPluginGenTags() {
    echo "Executing vimPluginGenTags"

    target="$out/@rtpPath@"
    mkdir -p $out/@rtpPath@

    # build help tags
    if [ -d "$target/doc" ]; then
        echo "Building help tags"
        if ! @vimBinary@ -N -u NONE -i NONE -n -E -s -V1 -c "helptags $target/doc" +quit!; then
        echo "Failed to build help tags!"
        exit 1
        fi
    else
        echo "No docs available for $target"
    fi

    if [ -n "$addonInfo" ]; then
        echo "$addonInfo" > $target/addon-info.json
    fi

    echo "Finished executing vimPluginInstallPhase"
}

preFixupHooks+=(vimPluginGenTags)