blob: 9ee238ccb970eabc934e5be5fb61d6e0a2dfef32 (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# Add a static content file to git
git::add () {
local -r content_dir="$CONTENT_BASE_DIR/$1"; shift
local file="$1"; shift
file=${file/$content_dir/.\/}
cd "$content_dir" &>/dev/null
git add "$file"
cd - &>/dev/null
}
# Remove a static content file from git
git::rm () {
local -r content_dir="$CONTENT_BASE_DIR/$1"; shift
local file="$1"; shift
file=${file/$content_dir/.\/}
cd "$content_dir" &>/dev/null
git rm "$file"
cd - &>/dev/null
}
# Commit all changes
git::commit () {
local -r content_dir="$CONTENT_BASE_DIR/$1"; shift
local -r message="$1"; shift
cd "$content_dir" &>/dev/null
git commit -a -m "$message"
if [[ "$GIT_PUSH" == yes ]]; then
git pull
git push
fi
cd - &>/dev/null
}
# Commit all changes
git::commit () {
local -r content_dir="$CONTENT_BASE_DIR/$1"; shift
local -r message="$1"; shift
cd "$content_dir" &>/dev/null
git commit -a -m "$message"
cd - &>/dev/null
}
|