From fe466a2e8f3101d06c8ee9b2c04e02f2746c4989 Mon Sep 17 00:00:00 2001 From: Freed-Wu Date: Thu, 31 Mar 2022 15:17:38 +0800 Subject: [PATCH] new package: ugit --- packages/ugit/build.sh | 17 +++++++++++++++ packages/ugit/ugit.patch | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 packages/ugit/build.sh create mode 100644 packages/ugit/ugit.patch diff --git a/packages/ugit/build.sh b/packages/ugit/build.sh new file mode 100644 index 000000000..1ddd0f6b3 --- /dev/null +++ b/packages/ugit/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/Bhupesh-V/ugit +TERMUX_PKG_DESCRIPTION="ugit helps you undo your last git command with grace. Your damage control git buddy" +TERMUX_PKG_LICENSE=MIT +TERMUX_PKG_MAINTAINER=@termux +TERMUX_PKG_VERSION=5.1 +TERMUX_PKG_SRCURL=$TERMUX_PKG_HOMEPAGE/archive/v$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=52e72f9d44c3160987cdc0a393ccce3c0c76e76aa6b3e792e4b7ef2891a2b09d +TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_DEPENDS='bash, ugit' +TERMUX_PKG_PLATFORM_INDEPENDENT=true + +termux_step_make_install() { + local bin="$(basename $TERMUX_PKG_HOMEPAGE)" + install -D "$bin" -t "$TERMUX_PREFIX/bin" + ln -sf "$TERMUX_PREFIX/bin/$bin" "$TERMUX_PREFIX/bin/gitundo" +} diff --git a/packages/ugit/ugit.patch b/packages/ugit/ugit.patch new file mode 100644 index 000000000..c7010236b --- /dev/null +++ b/packages/ugit/ugit.patch @@ -0,0 +1,47 @@ +diff --git a/ugit b/ugit +index ae0b8a2..4ff660f 100755 +--- a/ugit ++++ b/ugit +@@ -328,7 +328,6 @@ Available options: + + -h, --help Print this help and exit + -v, --version Print current ugit version +--u, --update Update ugit + -g, --guide Open ugit undo text guide + EOF + printf "\n%s\n" "Contact 📬️: $(tput bold)varshneybhupesh@gmail.com${RESET} for assistance" +@@ -344,25 +343,6 @@ get_changelog() { + echo -e "${CHANGELOG#* }" + } + +-ugit_update() { +- printf "%s\n" "Checking for updates ..." +- curl -s -L "$SCRIPT_URL" > "$TMP_FILE" +- NEW_VER=$(grep "^VERSION" "$TMP_FILE" | awk -F'[="]' '{print $3}') +- +- if [[ "$VERSION" < "$NEW_VER" ]]; then +- printf "Updating ugit \e[31;1m%s\e[0m -> \e[32;1m%s\e[0m\n" "$VERSION" "$NEW_VER" +- chmod +x "$TMP_FILE" +- # WIP +- if cp "$TMP_FILE" "$SCRIPT_NAME"; then printf "%s\n" "Done"; fi +- rm -f "$TMP_FILE" +- get_changelog +- else +- printf "%s\n" "ugit is already at the latest version ($VERSION)" +- rm -f "$TMP_FILE" +- fi +- exit 0 +-} +- + open_guide() { + GUIDE="https://bhupesh.gitbook.io/notes/git/how-to-undo-anything-in-git" + +@@ -407,8 +387,6 @@ main() { + case "$key" in + --version|-v) + show_version;; +- --update|-u) +- ugit_update;; + --help|-h) + print_help + exit;;