Files
disktree/packaging/install.sh
Tobi Lutke 92f4031216 0.9.0: screenshot, CI, and release builds
- The README opens with a screenshot, and says how to install a release.
- CI lints and tests every push and pull request on a pinned toolchain.
- Pushing a v* tag builds a release on the oldest supported Ubuntu (for
  glibc reach), checks the tag against Cargo.toml, runs the tests, and
  publishes disktree-<version>-x86_64-linux.tar.gz with a checksum. The
  archive carries install.sh, which installs the binary, desktop entry
  and icon into ~/.local without a Rust toolchain.
- The desktop entry passes a path (%f), not a URI, to disktree.
2026-09-24 17:13:38 -05:00

36 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# Install a disktree release: the binary, a desktop entry and an icon.
#
# ./install.sh # into ~/.local, no root needed
# sudo PREFIX=/usr/local ./install.sh
#
# The same three files `make install` puts in place, for a machine without a
# Rust toolchain.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
PREFIX=${PREFIX:-"$HOME/.local"}
BINDIR=${BINDIR:-"$PREFIX/bin"}
APPDIR=${APPDIR:-"$PREFIX/share/applications"}
ICONDIR=${ICONDIR:-"$PREFIX/share/icons/hicolor/scalable/apps"}
VERSION=$(cat "$here/VERSION")
install -d "$BINDIR" "$APPDIR" "$ICONDIR"
install -m755 "$here/disktree" "$BINDIR/disktree"
install -m644 "$here/disktree.svg" "$ICONDIR/disktree.svg"
sed -e "s|@BINDIR@|$BINDIR|" -e "s|@VERSION@|$VERSION|" \
"$here/disktree.desktop.in" > "$APPDIR/disktree.desktop"
chmod 644 "$APPDIR/disktree.desktop"
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database "$APPDIR" 2>/dev/null || true
fi
echo "installed disktree $VERSION:"
echo " $BINDIR/disktree"
echo " $APPDIR/disktree.desktop"
echo " $ICONDIR/disktree.svg"
case ":$PATH:" in
*":$BINDIR:"*) ;;
*) echo; echo "note: $BINDIR is not on PATH in this shell" ;;
esac