forked from alrra/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_local_config_files.sh
executable file
·77 lines (45 loc) · 1.38 KB
/
create_local_config_files.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "utils.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
create_bash_local() {
declare -r FILE_PATH="$HOME/.bash.local"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ ! -e "$FILE_PATH" ] || [ -z "$FILE_PATH" ]; then
printf "%s\n\n" "#!/bin/bash" >> "$FILE_PATH"
fi
print_result $? "$FILE_PATH"
}
create_gitconfig_local() {
declare -r FILE_PATH="$HOME/.gitconfig.local"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ ! -e "$FILE_PATH" ] || [ -z "$FILE_PATH" ]; then
printf "%s\n" \
"[commit]
# Sign commits using GPG.
# https://help.github.com/articles/signing-commits-using-gpg/
# gpgsign = true
[user]
name =
email =
# signingkey =" \
>> "$FILE_PATH"
fi
print_result $? "$FILE_PATH"
}
create_vimrc_local() {
declare -r FILE_PATH="$HOME/.vimrc.local"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ ! -e "$FILE_PATH" ]; then
printf "" >> "$FILE_PATH"
fi
print_result $? "$FILE_PATH"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
main() {
print_in_purple "\n • Create local config files\n\n"
create_bash_local
create_gitconfig_local
create_vimrc_local
}
main