add env parameter to npm.uninstall

This commit is contained in:
Justin Findlay 2015-06-05 19:25:49 -06:00
parent 36263405be
commit cb572f8c41

View file

@ -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'])