blob: b5c503d0a522901a27263bbdd3f3ccaf8eeac2e2 (
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
|
import pathlib
import platform
import textwrap
def is_ubuntu_2204():
return platform.freedesktop_os_release().get("VERSION_CODENAME") == "jammy"
def setup_bash():
if is_ubuntu_2204():
# clone the handy ~/.bashrc.d from Fedora
bash_aliases = pathlib.Path.home() / ".bash_aliases"
bash_aliases.write_text(textwrap.dedent("""
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
""".lstrip()))
|