blob: 47aee10d102483f39abde1baa7c4b35a9cafab0a (
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
|
post_install() {
local real_user="${SUDO_USER:-}"
# Skip when installed directly as root (no SUDO_USER)
if [ -z "$real_user" ] || [ "$real_user" = "root" ]; then
echo " -> Example configs installed to /usr/share/doc/kabekami-git/"
echo " Copy config.toml (or config.ja.toml) to ~/.config/kabekami/config.toml to get started."
return
fi
local user_home
user_home=$(getent passwd "$real_user" | cut -d: -f6) || return
local config_file="$user_home/.config/kabekami/config.toml"
if [ ! -f "$config_file" ]; then
install -Dm644 -o "$real_user" \
/usr/share/doc/kabekami-git/config.toml \
"$config_file"
echo " -> Installed default config for $real_user: $config_file"
echo " Japanese reference: /usr/share/doc/kabekami-git/config.ja.toml"
fi
}
post_upgrade() {
:
}
|