bundles/users: source users bashrc after loading global bashrc instead of overwriting it

This commit is contained in:
Franzi 2024-02-03 20:51:45 +01:00
parent c02a1f2a90
commit dcb9db3639
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 13 additions and 5 deletions

View file

@ -64,3 +64,8 @@ ${k}() {
${v} ${v}
} }
% endfor % endfor
if [[ -f "/etc/bashrc_bundlewrap/$(logname)" ]]
then
source "/etc/bashrc_bundlewrap/$(logname)"
fi

View file

@ -1,5 +1,9 @@
from os.path import exists, join from os.path import exists, join
directories['/etc/bashrc_bundlewrap'] = {
'purge': True,
}
files = { files = {
'/etc/bash.bashrc': { '/etc/bash.bashrc': {
'source': 'bashrc', 'source': 'bashrc',
@ -64,12 +68,11 @@ for username, attrs in node.metadata['users'].items():
} }
if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))): if exists(join(repo.path, 'data', 'users', 'files', 'bash', '{}.bashrc'.format(username))):
files[home + '/.bashrc'] = { files[f'/etc/bashrc_bundlewrap/{username}'] = {
'content_type': 'mako', 'content_type': 'mako',
'source': 'bash/{}.bashrc'.format(username), 'source': 'bash/{}.bashrc'.format(username),
} }
else: files[f"{home}/.bashrc"] = {
files[home + '/.bashrc'] = {
'delete': True, 'delete': True,
} }