mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
add env
parameter to npm.uninstall
This commit is contained in:
parent
36263405be
commit
cb572f8c41
1 changed files with 10 additions and 2 deletions
|
@ -151,7 +151,8 @@ def install(pkg=None,
|
|||
|
||||
def uninstall(pkg,
|
||||
dir=None,
|
||||
runas=None):
|
||||
runas=None,
|
||||
env=None):
|
||||
'''
|
||||
Uninstall an NPM package.
|
||||
|
||||
|
@ -167,6 +168,13 @@ def uninstall(pkg,
|
|||
runas
|
||||
The user to run NPM with
|
||||
|
||||
env
|
||||
Environment variables to set when invoking npm. Uses the same ``env``
|
||||
format as the :py:func:`cmd.run <salt.modules.cmdmod.run>` execution
|
||||
function.
|
||||
|
||||
.. versionadded:: 2015.5.3
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -182,7 +190,7 @@ def uninstall(pkg,
|
|||
|
||||
cmd += ' "{0}"'.format(pkg)
|
||||
|
||||
result = __salt__['cmd.run_all'](cmd, python_shell=False, cwd=dir, runas=runas)
|
||||
result = __salt__['cmd.run_all'](cmd, python_shell=False, cwd=dir, runas=runas, env=env)
|
||||
|
||||
if result['retcode'] != 0:
|
||||
log.error(result['stderr'])
|
||||
|
|
Loading…
Add table
Reference in a new issue