new package: ugit
This commit is contained in:
parent
8626c39c12
commit
fe466a2e8f
17
packages/ugit/build.sh
Normal file
17
packages/ugit/build.sh
Normal file
@ -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"
|
||||
}
|
47
packages/ugit/ugit.patch
Normal file
47
packages/ugit/ugit.patch
Normal file
@ -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;;
|
Loading…
Reference in New Issue
Block a user