composer: rename composer_install to composer_command
This commit is contained in:
parent
0b0cc7b049
commit
7fdfa01615
1 changed files with 2 additions and 3 deletions
|
@ -111,11 +111,10 @@ def parse_out(string):
|
||||||
def has_changed(string):
|
def has_changed(string):
|
||||||
return "Nothing to install or update" not in string
|
return "Nothing to install or update" not in string
|
||||||
|
|
||||||
def composer_install(module, command, options):
|
def composer_command(module, command, options=[]):
|
||||||
php_path = module.get_bin_path("php", True, ["/usr/local/bin"])
|
php_path = module.get_bin_path("php", True, ["/usr/local/bin"])
|
||||||
composer_path = module.get_bin_path("composer", True, ["/usr/local/bin"])
|
composer_path = module.get_bin_path("composer", True, ["/usr/local/bin"])
|
||||||
cmd = "%s %s %s %s" % (php_path, composer_path, command, " ".join(options))
|
cmd = "%s %s %s %s" % (php_path, composer_path, command, " ".join(options))
|
||||||
|
|
||||||
return module.run_command(cmd)
|
return module.run_command(cmd)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -165,7 +164,7 @@ def main():
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
options.append('--dry-run')
|
options.append('--dry-run')
|
||||||
|
|
||||||
rc, out, err = composer_install(module, command, options)
|
rc, out, err = composer_command(module, command, options)
|
||||||
|
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
output = parse_out(err)
|
output = parse_out(err)
|
||||||
|
|
Loading…
Reference in a new issue