From 150e7d4ff04988cb6db5aef597717a116e0f4e12 Mon Sep 17 00:00:00 2001 From: 42berlin <42berlin@noreply.localhost> Date: Tue, 28 Mar 2023 00:27:29 +0200 Subject: [PATCH] Add check function --- .bashrc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.bashrc b/.bashrc index 06b5612..50ea276 100644 --- a/.bashrc +++ b/.bashrc @@ -56,3 +56,20 @@ fi if [ -f /nfs/homes/tischmid/.config/synth-shell/better-history.sh ] && [ -n "$( echo $- | grep i )" ]; then source /nfs/homes/tischmid/.config/synth-shell/better-history.sh fi + +check () { + URL="${1}" + DIR="/tmp/tmp_repo_$(date +%s)" + + if [ -z "${URL}" ]; then + URL="$(git remote get-url origin)" + fi + + git clone --quiet "${URL}" "${DIR}" + if [ -d "${DIR}" ]; then + norminette "${DIR}" && printf '\033[42m%s\033[m\n' "Norminette success" || printf '\033[41m%s\033[m\n' "Norminette fail!!!" + rm -rf "${DIR}" + else + printf '\033[41m%s\033[m\n' "Could not clone the repo" + fi +} \ No newline at end of file