From 2748095a8e401ed6ecfe2364ae176faf3704f21b Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Tue, 17 Jun 2014 01:31:24 +0200 Subject: [PATCH] Allow executable to contain spaces NVM has a special script which loads the correct node version before executing a command. The syntax for this is `/usr/local/nvm/nvm-exec ...`, so `nvm-exec npm list --json` for example. But previously when specifying `executable='/usr/local/nvm/nvm-exec nvm'` this would not work because the string was treated as one executable. --- library/packaging/npm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/packaging/npm b/library/packaging/npm index 7034c7f9964..83f6962b505 100644 --- a/library/packaging/npm +++ b/library/packaging/npm @@ -113,9 +113,9 @@ class Npm(object): self.production = kwargs['production'] if kwargs['executable']: - self.executable = kwargs['executable'] + self.executable = kwargs['executable'].split(' ') else: - self.executable = module.get_bin_path('npm', True) + self.executable = [module.get_bin_path('npm', True)] if kwargs['version']: self.name_version = self.name + '@' + self.version @@ -124,7 +124,7 @@ class Npm(object): def _exec(self, args, run_in_check_mode=False, check_rc=True): if not self.module.check_mode or (self.module.check_mode and run_in_check_mode): - cmd = [self.executable] + args + cmd = self.executable + args if self.glbl: cmd.append('--global')