summaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/git
blob: 108cceacc65e79748612b808422411ba88136091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#
# Git wrapper.
#

# Load functions
LIB="`dirname $0`/../functions"
source "$LIB" || exit 1

# Aditional parameters
CWD="`pwd`"

# Run git command
shift

# Set working folder
if [ ! -z "$RELATIVE_PATH" ]; then
  WORK="$KEYDIR/$RELATIVE_PATH"
else
  WORK="$BASEDIR"
fi

mkdir -p "$WORK" && cd "$WORK" && git $*
cd "$CWD"