Use type=path for arguments, and remove code doing the conversion (#1903)

This commit is contained in:
Michael Scherer 2016-04-29 09:57:52 +02:00 committed by René Moser
parent e07a52b499
commit f7c421088a

View file

@ -154,7 +154,6 @@ class Npm(object):
#If path is specified, cd into that path and run the command.
cwd = None
if self.path:
self.path = os.path.abspath(os.path.expanduser(self.path))
if not os.path.exists(self.path):
os.makedirs(self.path)
if not os.path.isdir(self.path):
@ -212,10 +211,10 @@ class Npm(object):
def main():
arg_spec = dict(
name=dict(default=None),
path=dict(default=None),
path=dict(default=None, type='path'),
version=dict(default=None),
production=dict(default='no', type='bool'),
executable=dict(default=None),
executable=dict(default=None, type='path'),
registry=dict(default=None),
state=dict(default='present', choices=['present', 'absent', 'latest']),
ignore_scripts=dict(default=False, type='bool'),