Skip to content

Commit

Permalink
eza: install completions and man pages only for v0.18.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartFinn committed Jun 13, 2024
1 parent c3372f1 commit bb1b560
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions apps/eza@x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,42 @@ app_info() {
app_install() {
local version="${1:-$(app_version)}"
local package="${APP_NAME}_${APP_ARCH}-unknown-linux-gnu"
local _version="${version#v}"

wget -O "$SDD_TEMP_DIR/$package".tar.gz \
"https://github.com/eza-community/eza/releases/download/$version/$package".tar.gz
utils:extract "$SDD_TEMP_DIR/$package".tar.gz

wget -O "$SDD_TEMP_DIR/$version.tar.gz" \
"https://github.com/eza-community/eza/archive/$version.tar.gz"
utils:extract "$SDD_TEMP_DIR/$version.tar.gz"

cd "$SDD_TEMP_DIR/$APP_NAME-${version#v}" || exit 1

app_remove

# Install binary
install -vD -m755 "$SDD_TEMP_DIR/$APP_NAME" \
"$SDD_BIN_DIR/$APP_NAME" >&2

# Install extras
install -vD -m644 "completions/bash/$APP_NAME" \
"$SDD_BASH_COMPLETION_DIR/$APP_NAME" >&2
if utils:compare_versions "$_version" ge "0.18.13"; then
wget -O "$SDD_TEMP_DIR/completions-$_version".tar.gz \
"https://github.com/eza-community/eza/releases/download/$version/completions-$_version".tar.gz
utils:extract "$SDD_TEMP_DIR/completions-$_version".tar.gz

wget -O "$SDD_TEMP_DIR/man-$_version".tar.gz \
"https://github.com/eza-community/eza/releases/download/$version/man-$_version".tar.gz
utils:extract "$SDD_TEMP_DIR/man-$_version".tar.gz

install -vD -m644 "completions/zsh/_$APP_NAME" \
"$SDD_ZSH_COMPLETION_DIR/_$APP_NAME" >&2
install -vD -m644 "$SDD_TEMP_DIR/target/completions-$_version/$APP_NAME" \
"$SDD_BASH_COMPLETION_DIR/$APP_NAME" >&2

if command -v pandoc >/dev/null; then
# Generating man page using pandoc
pandoc -s -f markdown-smart -t man "man/eza.1.md" -o "man/eza.1"
pandoc -s -f markdown-smart -t man "man/eza_colors.5.md" -o "man/eza_colors.5"
pandoc -s -f markdown-smart -t man "man/eza_colors-explanation.5.md" \
-o "man/eza_colors-explanation.5"
install -vD -m644 "$SDD_TEMP_DIR/target/completions-$_version/_$APP_NAME" \
"$SDD_ZSH_COMPLETION_DIR/_$APP_NAME" >&2

# Install man page
install -vD -m644 "man/$APP_NAME.1" \
install -vD -m644 "$SDD_TEMP_DIR/target/man-$_version/$APP_NAME.1" \
"$SDD_MAN_DIR/man1/$APP_NAME.1" >&2

install -vD -m644 "man/${APP_NAME}_colors.5" \
install -vD -m644 "$SDD_TEMP_DIR/target/man-$_version/${APP_NAME}_colors.5" \
"$SDD_MAN_DIR/man5/${APP_NAME}_colors.5" >&2

install -vD -m644 "man/${APP_NAME}_colors-explanation.5" \
install -vD -m644 "$SDD_TEMP_DIR/target/man-$_version/${APP_NAME}_colors-explanation.5" \
"$SDD_MAN_DIR/man5/${APP_NAME}_colors-explanation.5" >&2
fi
}
Expand Down

0 comments on commit bb1b560

Please sign in to comment.