Preserve correct owner for .bashrc
when configuring nodejs
This commit is contained in:
parent
075f931b5e
commit
6479af6a57
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2019 Lance Edgar
|
||||
# Copyright © 2010-2023 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -46,6 +46,9 @@ def install(c, version=None, user=None):
|
|||
|
||||
profile = os.path.join(home, '.profile')
|
||||
kwargs = {'use_sudo': bool(user)}
|
||||
if kwargs['use_sudo']:
|
||||
c.sudo(f'touch {profile}')
|
||||
c.sudo(f'chown {user}: {profile}')
|
||||
append(c, profile, 'export NVM_DIR="{}"'.format(nvm), **kwargs)
|
||||
append(c, profile, '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"', **kwargs)
|
||||
append(c, profile, '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"', **kwargs)
|
||||
|
|
Loading…
Reference in a new issue