GitRoot

Craft your forge, Build your project, Grow your community freely
 1#!/usr/bin/env bash
 2
 3# SPDX-FileCopyrightText: 2026 Romain Maneschi <romain@gitroot.dev>
 4#
 5# SPDX-License-Identifier: EUPL-1.2
 6
 7MY_LOG=${MY_LOG:-"/tmp/mylog.txt"}
 8
 9_init() {
10    local SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
11}
12
13_init
14unset -f _init
15
16# quiet_git <cmd>...
17#   Like git but redirect stdout to $MY_LOG file
18function quiet_git() {
19    echo "🚀 git $@" >> $MY_LOG
20    GIT_TRACE=false GIT_TRACE_PACKET=false git "$@" &>> $MY_LOG
21}