diff --git a/utils/debian.sh b/utils/debian.sh index ad0a680..68af0e6 100755 --- a/utils/debian.sh +++ b/utils/debian.sh @@ -38,6 +38,7 @@ setup_commands() { DPKG="${dry}dpkg" GIT="${dry}git" GZIP="${dry}gzip" + HELP2MAN="${dry}help2man" LN="${dry}ln" MKDIR="${dry}mkdir" MV="${dry}mv" @@ -311,6 +312,43 @@ install_fd() ( ${MV} "${pkg}" /usr/local/stow/ ${STOW} -v -d /usr/local/stow "${pkg}" ) + +install_git_delta() ( + title "Install git-delta v${1}" + + ${MKDIR} git-delta + ${CD} git-delta + pkg="git-delta-${1}" + + info "Downloading release archive" + ${CURL} -LO "https://github.com/dandavison/delta/releases/download/${1}/git-delta_${1}_amd64.deb" + + info "Extracting release archive" + ${DPKG} --extract "git-delta_${1}_amd64.deb" . + ${MV} -v usr "${pkg}" + + info "Creating additional directories" + for subdir in share/man/man1 share/zsh/vendor-completions; do + ${MKDIR} -p "${pkg}/${subdir}" + done + + info "Cloning repository for shell completions" + ${GIT} clone --branch "${1}" --depth 1 https://github.com/dandavison/delta.git repo + + info "Packaging zsh completions" + ${MV} -v "repo/etc/completion/completion.zsh" "${pkg}/share/zsh/vendor-completions/_delta" + + info "Generating man pages" + ${HELP2MAN} --no-info --output "git-delta.1" "${pkg}/bin/delta" + ${SED} -i -e 's/\x1b\[[0-9;]*[Mm]//g' git-delta.1 + ${GZIP} -n9 git-delta.1 + ${MV} -v git-delta.1.gz "${pkg}/share/man/man1/" + + info "Installing package" + ${MV} "${pkg}" /usr/local/stow/ + ${STOW} -v -d /usr/local/stow "${pkg}" +) + parse_args() { while getopts 'hn' opt; do case "$opt" in @@ -347,6 +385,7 @@ main() { install_broot 1.36.1 install_eza 0.18.7 install_fd 9.0.0 + install_git_delta 0.17.0 grub_disable_timeout ensure_usr_local_man_manN