From fc3af8a3b3af5e3cd35c9c6b075e71e9ce43eb69 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:28:34 +0900 Subject: updates --- mac/.config/qutebrowser/userscripts/gitclone | 74 ---------------------------- 1 file changed, 74 deletions(-) delete mode 100755 mac/.config/qutebrowser/userscripts/gitclone (limited to 'mac/.config/qutebrowser/userscripts/gitclone') diff --git a/mac/.config/qutebrowser/userscripts/gitclone b/mac/.config/qutebrowser/userscripts/gitclone deleted file mode 100755 index ad62d17..0000000 --- a/mac/.config/qutebrowser/userscripts/gitclone +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# -# Author: palb91 -# Date: 2022 -# -# Clone a git repository directly from qutebrowser -# -# In config.py: -# bind('gc', 'spawn -u -- gitclone') -# -# # Run a shell command after successful clone -# import os -# os.environ['QUTE_POST_CLONE'] = 'notify-send "git clone" "${QUTE_URL}"' - -set -e - -# Local storage -BASE_DIR="${HOME}"/Public/repos -TEMP_DIR="$(mktemp -d)" - -# Get informations from userscripts variables -QUTE_URL="${QUTE_URL%%\#*}" -QUTE_URL="${QUTE_URL%%\?*}" -QUTE_URL="${QUTE_URL%%\&*}" - -DOMAIN="${QUTE_URL#*//}" -DOMAIN="${DOMAIN%%/*}" - -REPO="${QUTE_URL#*"${DOMAIN}"/}" -REPO="${REPO%/}" -REPO="${REPO##*/}" -[ "${REPO#\.}" != "${REPO}" ] && REPO="_${REPO}" - -BASE_REPO="${BASE_DIR}/${DOMAIN}/${REPO}" -TEMP_REPO="${TEMP_DIR}/${DOMAIN}/${REPO}" - -# logging -info() { printf 'message-info "%s"\n' "${*}" >>"${QUTE_FIFO}"; } -warn() { printf 'message-warning "%s"\n' "${*}" >>"${QUTE_FIFO}"; } -err() { - printf 'message-error "%s"\n' "${*}" >>"${QUTE_FIFO}" - return 1 -} -clean() { - rm -rf "${TEMP_DIR}" - exit "${1:-0}" -} - -# Check repo exists -if [ -d "${BASE_REPO}"/.git ]; then - warn "${REPO} already cloned in ${BASE_REPO}" - clean 0 - -# Try cloning -else - info "Cloning ${DOMAIN}/${REPO}..." - git clone "${QUTE_URL}" "${TEMP_REPO}" || - err "Error while cloning ${DOMAIN}/${REPO}, is it a repository?" - - if [ ! -d "${TEMP_REPO}"/.git ]; then - err 'An error occured, cloning failed...' - clean 2 - fi -fi - -# Move the temp folder to its final destination -[ -d "${BASE_REPO%/*}" ] || mkdir -p "${BASE_REPO%/*}" -mv "${TEMP_REPO}" "${BASE_REPO}" -info "${REPO} successfully cloned in ${BASE_REPO}" - -# Run post hook -if [ -n "${QUTE_POST_CLONE}" ]; then - eval "${QUTE_POST_CLONE}" -fi -- cgit v1.2.3