From 5504b1d9310ea171447e22b86e44272611884da2 Mon Sep 17 00:00:00 2001 From: Serhii Yeremenko Date: Mon, 7 Oct 2024 13:29:57 +0300 Subject: [PATCH] Add fclones app --- apps/fclones@x86_64 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 apps/fclones@x86_64 diff --git a/apps/fclones@x86_64 b/apps/fclones@x86_64 new file mode 100644 index 0000000..7437b6b --- /dev/null +++ b/apps/fclones@x86_64 @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -euo pipefail + +app_info() { + utils:info "Efficient Duplicate File Finder" +} + +app_install() { + local version="${1:-$(app_version)}" + local package="$APP_NAME-${version#v}-linux-musl-$APP_ARCH" + + utils:get_file \ + "https://github.com/pkolaczk/fclones/releases/download/$version/$package.tar.gz" \ + "$SDD_TEMP_DIR/$package.tar.gz" + utils:extract "$SDD_TEMP_DIR/$package.tar.gz" + + cd "$SDD_TEMP_DIR/target/$APP_ARCH-unknown-linux-musl/release" || exit 1 + + app_remove + + install -vD -m755 "$APP_NAME" "$SDD_BIN_DIR/$APP_NAME" >&2 +} + +app_remove() { + rm -vf "$SDD_BIN_DIR/$APP_NAME" >&2 +} + +app_version() { + utils:github_latest_release 'pkolaczk/fclones' +} + +SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")" + +# shellcheck source=./_utils.sh +source "$SCRIPT_DIR/_utils.sh" + +utils:parser "$@"