aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAlec Goncharow <alec@goncharow.dev>2024-02-29 22:57:46 -0500
committerAlec Goncharow <alec@goncharow.dev>2024-02-29 22:57:46 -0500
commit82092fe19a0ff0d0e4bed2ccfd4351cbb2d10d9e (patch)
treeb096fcf91d3739649dabad3a7176709d914ff877 /bin
parent68677e4b0faec5b746a27bec036477ebf718f3c0 (diff)
embrace autocomplete defaults, add nocheckin pre-commit hook
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nocheckin37
-rwxr-xr-xbin/runelite3
2 files changed, 40 insertions, 0 deletions
diff --git a/bin/nocheckin b/bin/nocheckin
new file mode 100755
index 0000000..8f3779b
--- /dev/null
+++ b/bin/nocheckin
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Author: xezrunner (github.com/xezrunner)
+# Credit: DustinGadal on r/Jai
+# https://www.reddit.com/r/Jai/comments/jp0vjy/nocheckin_behavior_in_gitsourcetree/gbfhzd1/
+
+# Required programs/utilities for default behavior (as-is):
+# git, grep, xargs
+
+# This pre-commit hook/script checks for the existence of the word "$SEARCH_TARGET"
+# in your *staged* source files, then aborts the commit if any matches were found.
+# It also shows where you have them inside the file.
+
+SEARCH_TARGET="nocheckin"
+
+CL_BRED='\e[1;31m'
+CL_NONE='\e[0m'
+
+MESSAGE_0="${CL_BRED}Error:${CL_NONE} $SEARCH_TARGET(s) were found in "
+MESSAGE_1="file(s) - ${CL_BRED}ignoring commit:${CL_NONE}"
+
+_=$(git status)
+if [ $? -ne 0 ]; then
+ exit 1;
+fi
+
+SEARCH_CMD="git diff --staged -i --diff-filter=d --name-only -G $SEARCH_TARGET --relative $PWD"
+GREP_CMD="grep -H $SEARCH_TARGET -n --color=always" # <filename>:line******
+
+# Get the amount of files that we found the search target in.
+# I use 'wc -l' (line count of command output) for this:
+STATUS=$($SEARCH_CMD | wc -l)
+
+if ((STATUS > 0)); then
+ echo -e $MESSAGE_0 $STATUS $MESSAGE_1;
+ ($SEARCH_CMD | xargs $GREP_CMD);
+ exit 1;
+fi
diff --git a/bin/runelite b/bin/runelite
new file mode 100755
index 0000000..54cbb6f
--- /dev/null
+++ b/bin/runelite
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+_JAVA_AWT_WM_NONREPARENTING=1 ~/runelite/runelite & disown